Search in sources :

Example 1 with SetTableRemarksChange

use of liquibase.change.core.SetTableRemarksChange in project liquibase by liquibase.

the class ChangedTableChangeGenerator method fixChanged.

@Override
public Change[] fixChanged(DatabaseObject changedObject, ObjectDifferences differences, DiffOutputControl control, Database referenceDatabase, final Database comparisonDatabase, ChangeGeneratorChain chain) {
    Table table = (Table) changedObject;
    Difference changedRemarks = differences.getDifference("remarks");
    if (changedRemarks != null) {
        SetTableRemarksChange change = new SetTableRemarksChange();
        if (control.getIncludeCatalog()) {
            change.setCatalogName(table.getSchema().getCatalogName());
        }
        if (control.getIncludeSchema()) {
            change.setSchemaName(table.getSchema().getName());
        }
        change.setTableName(table.getName());
        change.setRemarks(table.getRemarks());
        return new Change[] { change };
    }
    return null;
}
Also used : Table(liquibase.structure.core.Table) Difference(liquibase.diff.Difference) SetTableRemarksChange(liquibase.change.core.SetTableRemarksChange) Change(liquibase.change.Change) SetTableRemarksChange(liquibase.change.core.SetTableRemarksChange)

Aggregations

Change (liquibase.change.Change)1 SetTableRemarksChange (liquibase.change.core.SetTableRemarksChange)1 Difference (liquibase.diff.Difference)1 Table (liquibase.structure.core.Table)1