Make drop migrations idempotent.

This commit is contained in:
Michael Bayne
2007-02-18 21:40:13 +00:00
parent be56250d8e
commit 0a3ac07001
@@ -48,6 +48,12 @@ public abstract class EntityMigration extends Modifier
}
public int invoke (Connection conn) throws SQLException {
if (!JDBCUtil.tableContainsColumn(conn, _tableName, _columnName)) {
// we'll accept this inconsistency
log.warning("Column drop appears already performed.");
return 0;
}
Statement stmt = conn.createStatement();
try {
log.info("Dropping '" + _columnName + "' from " + _tableName);