Make drop migrations idempotent.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2048 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2007-02-18 21:40:13 +00:00
parent bbace45059
commit f77ac4bbc2
@@ -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);