Skip to content

Commit

Permalink
0001376: DB2 table needs reorg after dropping a column.
Browse files Browse the repository at this point in the history
  • Loading branch information
abrougher committed Aug 8, 2013
1 parent 7726395 commit dc681ee
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -250,6 +250,8 @@ protected void processChange(Database currentModel, Database desiredModel,
ddl.append("DROP COLUMN ");
printIdentifier(getColumnName(change.getColumn()), ddl);
printEndOfStatement(ddl);
writeReorgStmt(change.getChangedTable(), ddl);
printEndOfStatement(ddl);
change.apply(currentModel, delimitedIdentifierModeOn);
}

Expand Down Expand Up @@ -285,9 +287,13 @@ protected void processChange(Database currentModel, Database desiredModel,
protected void writeExternalPrimaryKeysCreateStmt(Table table, Column[] primaryKeyColumns,
StringBuilder ddl) {
super.writeExternalPrimaryKeysCreateStmt(table, primaryKeyColumns, ddl);
writeReorgStmt(table, ddl);
printEndOfStatement(ddl);
}

protected void writeReorgStmt(Table table, StringBuilder ddl) {
ddl.append("CALL SYSPROC.ADMIN_CMD('REORG TABLE ");
printlnIdentifier(getTableName(table.getName()), ddl);
ddl.append("')");
printEndOfStatement(ddl);
}
}

0 comments on commit dc681ee

Please sign in to comment.