use of liquibase.command.core.DiffCommand in project liquibase by liquibase.
the class CommandLineUtils method doDiff.
public static void doDiff(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons) throws LiquibaseException {
DiffCommand diffCommand = (DiffCommand) CommandFactory.getInstance().getCommand("diff");
diffCommand.setReferenceDatabase(referenceDatabase).setTargetDatabase(targetDatabase).setCompareControl(new CompareControl(schemaComparisons, snapshotTypes)).setSnapshotTypes(snapshotTypes).setOutputStream(System.out);
System.out.println("");
System.out.println("Diff Results:");
try {
diffCommand.execute();
} catch (CommandExecutionException e) {
throw new LiquibaseException(e);
}
}
Aggregations