use of liquibase.command.CommandScope in project liquibase by liquibase.
the class DiffToChangeLogCommand method run.
@Override
public CommandResult run() throws Exception {
InternalSnapshotCommandStep.logUnsupportedDatabase(this.getReferenceDatabase(), this.getClass());
final CommandScope commandScope = new CommandScope("diffToChangeLogInternal");
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.REFERENCE_DATABASE_ARG, getReferenceDatabase());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.TARGET_DATABASE_ARG, getTargetDatabase());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.SNAPSHOT_TYPES_ARG, getSnapshotTypes());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.SNAPSHOT_LISTENER_ARG, getSnapshotListener());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.REFERENCE_SNAPSHOT_CONTROL_ARG, getReferenceSnapshotControl());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.TARGET_SNAPSHOT_CONTROL_ARG, getTargetSnapshotControl());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.OBJECT_CHANGE_FILTER_ARG, getObjectChangeFilter());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.COMPARE_CONTROL_ARG, getCompareControl());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.CHANGELOG_FILE_ARG, getChangeLogFile());
commandScope.addArgumentValue(InternalDiffChangelogCommandStep.DIFF_OUTPUT_CONTROL_ARG, getDiffOutputControl());
commandScope.setOutput(getOutputStream());
commandScope.execute();
return new CommandResult("OK");
}
use of liquibase.command.CommandScope in project liquibase by liquibase.
the class GenerateChangeLogCommand method run.
@Override
public CommandResult run() throws Exception {
InternalSnapshotCommandStep.logUnsupportedDatabase(this.getReferenceDatabase(), this.getClass());
final CommandScope commandScope = new CommandScope("generateChangeLogInternal");
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.REFERENCE_DATABASE_ARG, getReferenceDatabase());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.TARGET_DATABASE_ARG, getTargetDatabase());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.SNAPSHOT_TYPES_ARG, getSnapshotTypes());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.SNAPSHOT_LISTENER_ARG, getSnapshotListener());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.REFERENCE_SNAPSHOT_CONTROL_ARG, getReferenceSnapshotControl());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.TARGET_SNAPSHOT_CONTROL_ARG, getTargetSnapshotControl());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.OBJECT_CHANGE_FILTER_ARG, getObjectChangeFilter());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.COMPARE_CONTROL_ARG, getCompareControl());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.CHANGELOG_FILE_ARG, getChangeLogFile());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.DIFF_OUTPUT_CONTROL_ARG, getDiffOutputControl());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.AUTHOR_ARG, getAuthor());
commandScope.addArgumentValue(InternalGenerateChangelogCommandStep.CONTEXT_ARG, getContext());
commandScope.setOutput(getOutputStream());
commandScope.execute();
return new CommandResult("OK");
}
use of liquibase.command.CommandScope in project liquibase by liquibase.
the class HistoryCommand method run.
@Override
public CommandResult run() throws Exception {
final CommandScope commandScope = new CommandScope("internalHistory");
commandScope.setOutput(getOutputStream());
commandScope.addArgumentValue(InternalHistoryCommandStep.DATABASE_ARG, this.getDatabase());
commandScope.addArgumentValue(InternalHistoryCommandStep.DATE_FORMAT_ARG, this.dateFormat);
commandScope.execute();
return new CommandResult("OK");
}
use of liquibase.command.CommandScope in project liquibase by liquibase.
the class Main method executeSyncHub.
private void executeSyncHub(Database database, Liquibase liquibase) throws CommandLineParsingException, LiquibaseException, CommandExecutionException {
Map<String, Object> argsMap = new HashMap<>();
CommandScope liquibaseCommand = createLiquibaseCommand(database, liquibase, "internalSyncHub", argsMap);
liquibaseCommand.addArgumentValue(InternalSyncHubCommandStep.HUB_CONNECTION_ID_ARG, hubConnectionId == null ? null : UUID.fromString(hubConnectionId)).addArgumentValue(InternalSyncHubCommandStep.URL_ARG, url).addArgumentValue(InternalSyncHubCommandStep.DATABASE_ARG, database).addArgumentValue(InternalSyncHubCommandStep.HUB_PROJECT_ID_ARG, hubProjectId == null ? null : UUID.fromString(hubProjectId));
liquibaseCommand.execute();
}
use of liquibase.command.CommandScope in project liquibase by liquibase.
the class CommandLineUtils method createDiffCommand.
public static CommandScope createDiffCommand(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, ObjectChangeFilter objectChangeFilter, PrintStream output) throws CommandExecutionException {
CommandScope diffCommand = new CommandScope("internalDiff");
diffCommand.addArgumentValue(InternalDiffCommandStep.REFERENCE_DATABASE_ARG, referenceDatabase).addArgumentValue(InternalDiffCommandStep.TARGET_DATABASE_ARG, targetDatabase).addArgumentValue(InternalDiffCommandStep.COMPARE_CONTROL_ARG, new CompareControl(schemaComparisons, snapshotTypes)).addArgumentValue(InternalDiffCommandStep.OBJECT_CHANGE_FILTER_ARG, objectChangeFilter).addArgumentValue(InternalDiffCommandStep.SNAPSHOT_TYPES_ARG, InternalDiffCommandStep.parseSnapshotTypes(snapshotTypes));
diffCommand.setOutput(output);
return diffCommand;
}
Aggregations