@Override
public Change[] fixChanged(DatabaseObject changedObject, ObjectDifferences differences, DiffOutputControl control, Database referenceDatabase, Database comparisonDatabase, ChangeGeneratorChain chain) {
PrimaryKey pk = (PrimaryKey) changedObject;
DropPrimaryKeyChange dropPkChange = new DropPrimaryKeyChange();
dropPkChange.setTableName(pk.getTable().getName());
AddPrimaryKeyChange addPkChange = new AddPrimaryKeyChange();
addPkChange.setTableName(pk.getTable().getName());
addPkChange.setColumnNames(pk.getColumnNames());
addPkChange.setConstraintName(pk.getName());
if (control.getIncludeCatalog()) {
dropPkChange.setCatalogName(pk.getSchema().getCatalogName());
addPkChange.setCatalogName(pk.getSchema().getCatalogName());
}
if (control.getIncludeSchema()) {
dropPkChange.setSchemaName(pk.getSchema().getName());
addPkChange.setSchemaName(pk.getSchema().getName());
}
List<Column> referenceColumns = (List<Column>) differences.getDifference("columns").getReferenceValue();
List<Column> comparedColumns = (List<Column>) differences.getDifference("columns").getComparedValue();