#557 - DDL - DB Migration refactor - remove drop.ddl and use pendingDrops.

This commit is contained in:
Robin Bygrave
2016-02-11 20:26:53 +13:00
parent 1bee6fcae5
commit 6b490ed8b1
7 changed files with 9 additions and 51 deletions
@@ -179,8 +179,4 @@ public class DdlWrite {
return rollback;
}
public DdlBuffer drop() {
return apply;
}
}
@@ -544,7 +544,7 @@ public class BaseTableDdl implements TableDdl {
@Override
public void generate(DdlWrite writer, DropTable dropTable) throws IOException {
dropTable(writer.drop(), dropTable.getName());
dropTable(writer.apply(), dropTable.getName());
}
/**
@@ -555,14 +555,14 @@ public class BaseTableDdl implements TableDdl {
String tableName = dropColumn.getTableName();
alterTableDropColumn(writer.drop(), tableName, dropColumn.getColumnName());
alterTableDropColumn(writer.apply(), tableName, dropColumn.getColumnName());
if (isTrue(dropColumn.isWithHistory())) {
// also drop from the history table
regenerateHistoryTriggers(tableName, HistoryTableUpdate.Change.DROP, dropColumn.getColumnName());
alterTableDropColumn(writer.drop(), historyTable(tableName), dropColumn.getColumnName());
alterTableDropColumn(writer.apply(), historyTable(tableName), dropColumn.getColumnName());
}
writer.drop().end();
writer.apply().end();
}
/**