Search in sources :

Example 1 with DiffCommand

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);
    }
}
Also used : CompareControl(liquibase.diff.compare.CompareControl) CommandExecutionException(liquibase.command.CommandExecutionException) DiffCommand(liquibase.command.core.DiffCommand)

Aggregations

CommandExecutionException (liquibase.command.CommandExecutionException)1 DiffCommand (liquibase.command.core.DiffCommand)1 CompareControl (liquibase.diff.compare.CompareControl)1