Search in sources :

Example 1 with DiffToChangeLogCommand

use of liquibase.command.core.DiffToChangeLogCommand in project liquibase by liquibase.

the class CommandLineUtils method doDiffToChangeLog.

public static void doDiffToChangeLog(String changeLogFile, Database referenceDatabase, Database targetDatabase, DiffOutputControl diffOutputControl, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons) throws LiquibaseException, IOException, ParserConfigurationException {
    DiffToChangeLogCommand command = (DiffToChangeLogCommand) CommandFactory.getInstance().getCommand("diffChangeLog");
    command.setReferenceDatabase(referenceDatabase).setTargetDatabase(targetDatabase).setSnapshotTypes(snapshotTypes).setCompareControl(new CompareControl(schemaComparisons, snapshotTypes)).setOutputStream(System.out);
    command.setChangeLogFile(changeLogFile).setDiffOutputControl(diffOutputControl);
    try {
        command.execute();
    } catch (CommandExecutionException e) {
        throw new LiquibaseException(e);
    }
}
Also used : DiffToChangeLogCommand(liquibase.command.core.DiffToChangeLogCommand) CompareControl(liquibase.diff.compare.CompareControl) CommandExecutionException(liquibase.command.CommandExecutionException)

Aggregations

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