Search in sources :

Example 1 with DropViewChange

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

the class UnexpectedViewChangeGenerator method fixUnexpected.

@Override
public Change[] fixUnexpected(DatabaseObject unexpectedObject, DiffOutputControl control, Database referenceDatabase, Database comparisonDatabase, ChangeGeneratorChain chain) {
    View view = (View) unexpectedObject;
    DropViewChange change = new DropViewChange();
    change.setViewName(view.getName());
    if (control.getIncludeCatalog()) {
        change.setCatalogName(view.getSchema().getCatalogName());
    }
    if (control.getIncludeSchema()) {
        change.setSchemaName(view.getSchema().getName());
    }
    for (Column column : view.getColumns()) {
        control.setAlreadyHandledUnexpected(column);
    }
    ;
    return new Change[] { change };
}
Also used : Column(liquibase.structure.core.Column) DropViewChange(liquibase.change.core.DropViewChange) DropViewChange(liquibase.change.core.DropViewChange) Change(liquibase.change.Change) View(liquibase.structure.core.View)

Aggregations

Change (liquibase.change.Change)1 DropViewChange (liquibase.change.core.DropViewChange)1 Column (liquibase.structure.core.Column)1 View (liquibase.structure.core.View)1