Make drop migrations idempotent.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2048 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -48,6 +48,12 @@ public abstract class EntityMigration extends Modifier
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int invoke (Connection conn) throws SQLException {
|
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();
|
Statement stmt = conn.createStatement();
|
||||||
try {
|
try {
|
||||||
log.info("Dropping '" + _columnName + "' from " + _tableName);
|
log.info("Dropping '" + _columnName + "' from " + _tableName);
|
||||||
|
|||||||
Reference in New Issue
Block a user