Search in sources :

Example 6 with ColumnSizeChange

use of org.jumpmind.db.alter.ColumnSizeChange in project symmetric-ds by JumpMind.

the class PostgreSqlDdlBuilder method processTableStructureChanges.

@Override
protected void processTableStructureChanges(Database currentModel, Database desiredModel, Table sourceTable, Table targetTable, List<TableChange> changes, StringBuilder ddl) {
    for (Iterator<TableChange> changeIt = changes.iterator(); changeIt.hasNext(); ) {
        TableChange change = changeIt.next();
        if (change instanceof AddColumnChange) {
            AddColumnChange addColumnChange = (AddColumnChange) change;
            processChange(currentModel, desiredModel, addColumnChange, ddl);
            changeIt.remove();
        } else if (change instanceof RemoveColumnChange) {
            processChange(currentModel, desiredModel, (RemoveColumnChange) change, ddl);
            changeIt.remove();
        } else if (change instanceof CopyColumnValueChange) {
            CopyColumnValueChange copyColumnChange = (CopyColumnValueChange) change;
            processChange(currentModel, desiredModel, copyColumnChange, ddl);
            changeIt.remove();
        } else if (change instanceof ColumnDefaultValueChange) {
            processChange(currentModel, desiredModel, (ColumnDefaultValueChange) change, ddl);
            changeIt.remove();
        } else if (change instanceof ColumnRequiredChange) {
            processChange(currentModel, desiredModel, (ColumnRequiredChange) change, ddl);
            changeIt.remove();
        } else if (change instanceof ColumnSizeChange) {
            processChange(currentModel, desiredModel, (ColumnSizeChange) change, ddl);
            changeIt.remove();
        } else if (change instanceof PrimaryKeyChange) {
            processChange(currentModel, desiredModel, (PrimaryKeyChange) change, ddl);
            changeIt.remove();
        } else if (change instanceof ColumnAutoIncrementChange) {
            if (processChange(currentModel, desiredModel, (ColumnAutoIncrementChange) change, ddl)) {
                changeIt.remove();
            }
        }
    }
    super.processTableStructureChanges(currentModel, desiredModel, sourceTable, targetTable, changes, ddl);
}
Also used : CopyColumnValueChange(org.jumpmind.db.alter.CopyColumnValueChange) ColumnDefaultValueChange(org.jumpmind.db.alter.ColumnDefaultValueChange) PrimaryKeyChange(org.jumpmind.db.alter.PrimaryKeyChange) RemoveColumnChange(org.jumpmind.db.alter.RemoveColumnChange) ColumnRequiredChange(org.jumpmind.db.alter.ColumnRequiredChange) ColumnAutoIncrementChange(org.jumpmind.db.alter.ColumnAutoIncrementChange) ColumnSizeChange(org.jumpmind.db.alter.ColumnSizeChange) AddColumnChange(org.jumpmind.db.alter.AddColumnChange) TableChange(org.jumpmind.db.alter.TableChange)

Aggregations

AddColumnChange (org.jumpmind.db.alter.AddColumnChange)6 ColumnSizeChange (org.jumpmind.db.alter.ColumnSizeChange)6 RemoveColumnChange (org.jumpmind.db.alter.RemoveColumnChange)6 TableChange (org.jumpmind.db.alter.TableChange)6 CopyColumnValueChange (org.jumpmind.db.alter.CopyColumnValueChange)5 ColumnAutoIncrementChange (org.jumpmind.db.alter.ColumnAutoIncrementChange)4 ArrayList (java.util.ArrayList)3 AddPrimaryKeyChange (org.jumpmind.db.alter.AddPrimaryKeyChange)3 ColumnDataTypeChange (org.jumpmind.db.alter.ColumnDataTypeChange)3 ColumnDefaultValueChange (org.jumpmind.db.alter.ColumnDefaultValueChange)3 ColumnRequiredChange (org.jumpmind.db.alter.ColumnRequiredChange)3 PrimaryKeyChange (org.jumpmind.db.alter.PrimaryKeyChange)3 RemovePrimaryKeyChange (org.jumpmind.db.alter.RemovePrimaryKeyChange)3 HashSet (java.util.HashSet)2 ColumnChange (org.jumpmind.db.alter.ColumnChange)2 Column (org.jumpmind.db.model.Column)2 AddForeignKeyChange (org.jumpmind.db.alter.AddForeignKeyChange)1 AddIndexChange (org.jumpmind.db.alter.AddIndexChange)1 IModelChange (org.jumpmind.db.alter.IModelChange)1 RemoveForeignKeyChange (org.jumpmind.db.alter.RemoveForeignKeyChange)1