Skip to content

Commit

Permalink
0001045: Upgrade from 3.0.9 to 3.3.1 fails. Fix the oracle dialect so…
Browse files Browse the repository at this point in the history
… it can run alter statements to change column sizes
  • Loading branch information
chenson42 committed Feb 14, 2013
1 parent 85b0b70 commit a2dd46b
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -30,6 +30,7 @@
import org.jumpmind.db.alter.ColumnDataTypeChange;
import org.jumpmind.db.alter.ColumnDefaultValueChange;
import org.jumpmind.db.alter.ColumnRequiredChange;
import org.jumpmind.db.alter.ColumnSizeChange;
import org.jumpmind.db.alter.PrimaryKeyChange;
import org.jumpmind.db.alter.RemoveColumnChange;
import org.jumpmind.db.alter.RemovePrimaryKeyChange;
Expand Down Expand Up @@ -325,6 +326,16 @@ public String getSelectLastIdentityValues(Table table) {
return null;
}
}

protected void processChange(Database currentModel, Database desiredModel,
ColumnSizeChange change, StringBuilder ddl) {
writeTableAlterStmt(change.getChangedTable(), ddl);
ddl.append(" MODIFY ");
Column column = change.getChangedColumn();
printIdentifier(getColumnName(column), ddl);
ddl.append(getSqlType(column));
printEndOfStatement(ddl);
}

@Override
protected void processTableStructureChanges(Database currentModel, Database desiredModel,
Expand All @@ -339,6 +350,9 @@ protected void processTableStructureChanges(Database currentModel, Database desi
// we need to rebuild the full table
return;
}
} else if (change instanceof ColumnSizeChange) {
processChange(currentModel, desiredModel, (ColumnSizeChange) change, ddl);
changeIt.remove();
} else if (change instanceof ColumnDefaultValueChange) {
processChange(currentModel, desiredModel, (ColumnDefaultValueChange) change, ddl);
changeIt.remove();
Expand Down

0 comments on commit a2dd46b

Please sign in to comment.