Make drop migrations idempotent.
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