use of liquibase.structure.core.Sequence in project liquibase by liquibase.
the class MissingSequenceChangeGenerator method fixMissing.
@Override
public Change[] fixMissing(DatabaseObject missingObject, DiffOutputControl control, Database referenceDatabase, Database comparisonDatabase, ChangeGeneratorChain chain) {
Sequence sequence = (Sequence) missingObject;
CreateSequenceChange change = new CreateSequenceChange();
change.setSequenceName(sequence.getName());
if (control.getIncludeCatalog()) {
change.setCatalogName(sequence.getSchema().getCatalogName());
}
if (control.getIncludeSchema()) {
change.setSchemaName(sequence.getSchema().getName());
}
change.setStartValue(sequence.getStartValue());
change.setIncrementBy(sequence.getIncrementBy());
change.setMinValue(sequence.getMinValue());
change.setMaxValue(sequence.getMaxValue());
change.setCacheSize(sequence.getCacheSize());
change.setCycle(sequence.getWillCycle());
change.setOrdered(sequence.getOrdered());
return new Change[] { change };
}
Aggregations