@Override
public Change[] fixMissing(DatabaseObject missingObject, DiffOutputControl control, Database referenceDatabase, Database comparisonDatabase, ChangeGeneratorChain chain) {
Index index = (Index) missingObject;
CreateIndexChange change = createCreateIndexChange();
change.setTableName(index.getTable().getName());
if (control.getIncludeTablespace()) {
change.setTablespace(index.getTablespace());
}
if (control.getIncludeCatalog()) {
change.setCatalogName(index.getTable().getSchema().getCatalogName());
}
if (control.getIncludeSchema()) {
change.setSchemaName(index.getTable().getSchema().getName());
}
change.setIndexName(index.getName());
change.setUnique(index.isUnique());
change.setAssociatedWith(index.getAssociatedWithAsString());
change.setClustered(index.getClustered());
// if (index.getAssociatedWith().contains(Index.MARK_PRIMARY_KEY) || index.getAssociatedWith().contains(Index.MARK_FOREIGN_KEY) || index.getAssociatedWith().contains(Index.MARK_UNIQUE_CONSTRAINT)) {
// continue;
// }
for (Column column : index.getColumns()) {
change.addColumn(new AddColumnConfig(column));
}
return new Change[] { change };
}