11/*
2- * Copyright 2015 original authors
2+ * Copyright 2015-2024 original authors
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -31,8 +31,12 @@ import liquibase.changelog.filter.ContextChangeSetFilter
3131import liquibase.changelog.filter.CountChangeSetFilter
3232import liquibase.changelog.filter.DbmsChangeSetFilter
3333import liquibase.command.CommandScope
34- import liquibase.command.core.InternalDiffChangelogCommandStep
35- import liquibase.command.core.InternalGenerateChangelogCommandStep
34+ import liquibase.command.core.DiffChangelogCommandStep
35+ import liquibase.command.core.GenerateChangelogCommandStep
36+ import liquibase.command.core.helpers.DbUrlConnectionCommandStep
37+ import liquibase.command.core.helpers.DiffOutputControlCommandStep
38+ import liquibase.command.core.helpers.PreCompareCommandStep
39+ import liquibase.command.core.helpers.ReferenceDbUrlConnectionCommandStep
3640import liquibase.database.Database
3741import liquibase.database.DatabaseConnection
3842import liquibase.database.DatabaseFactory
@@ -240,10 +244,14 @@ trait DatabaseMigrationCommand {
240244 def changeLogFilePath = changeLogFile?. path
241245 def compareControl = new CompareControl ([] as CompareControl.SchemaComparison [], null as String )
242246 final CommandScope commandScope = new CommandScope (" groovyGenerateChangeLog" )
243- commandScope. addArgumentValue(InternalGenerateChangelogCommandStep . REFERENCE_DATABASE_ARG , originalDatabase)
244- commandScope. addArgumentValue(InternalGenerateChangelogCommandStep . CHANGELOG_FILE_ARG , changeLogFilePath)
245- commandScope. addArgumentValue(InternalGenerateChangelogCommandStep . COMPARE_CONTROL_ARG , compareControl)
246- commandScope. addArgumentValue(InternalGenerateChangelogCommandStep . DIFF_OUTPUT_CONTROL_ARG , createDiffOutputControl())
247+ commandScope. addArgumentValue(ReferenceDbUrlConnectionCommandStep . REFERENCE_DATABASE_ARG , originalDatabase)
248+ commandScope. addArgumentValue(DiffChangelogCommandStep . CHANGELOG_FILE_ARG , changeLogFilePath)
249+ commandScope. addArgumentValue(DbUrlConnectionCommandStep . DATABASE_ARG , originalDatabase)
250+ commandScope. addArgumentValue(PreCompareCommandStep . COMPARE_CONTROL_ARG , compareControl)
251+ commandScope. addArgumentValue(DiffOutputControlCommandStep . INCLUDE_CATALOG_ARG , true )
252+ commandScope. addArgumentValue(DiffOutputControlCommandStep . INCLUDE_SCHEMA_ARG , true )
253+ commandScope. addArgumentValue(DiffOutputControlCommandStep . INCLUDE_TABLESPACE_ARG , true )
254+ commandScope. addArgumentValue(GenerateChangelogCommandStep . OVERWRITE_OUTPUT_FILE_ARG , true )
247255 commandScope. setOutput(System . out)
248256 commandScope. execute()
249257 }
@@ -252,11 +260,13 @@ trait DatabaseMigrationCommand {
252260 def changeLogFilePath = changeLogFile?. path
253261 def compareControl = new CompareControl ([] as CompareControl.SchemaComparison [], null as String )
254262 final CommandScope commandScope = new CommandScope (" groovyDiffChangelog" )
255- commandScope. addArgumentValue(InternalDiffChangelogCommandStep . REFERENCE_DATABASE_ARG , referenceDatabase)
256- commandScope. addArgumentValue(InternalDiffChangelogCommandStep . TARGET_DATABASE_ARG , targetDatabase)
257- commandScope. addArgumentValue(InternalDiffChangelogCommandStep . CHANGELOG_FILE_ARG , changeLogFilePath)
258- commandScope. addArgumentValue(InternalDiffChangelogCommandStep . COMPARE_CONTROL_ARG , compareControl)
259- commandScope. addArgumentValue(InternalDiffChangelogCommandStep . DIFF_OUTPUT_CONTROL_ARG , createDiffOutputControl())
263+ commandScope. addArgumentValue(ReferenceDbUrlConnectionCommandStep . REFERENCE_DATABASE_ARG , referenceDatabase)
264+ commandScope. addArgumentValue(DbUrlConnectionCommandStep . DATABASE_ARG , targetDatabase)
265+ commandScope. addArgumentValue(DiffChangelogCommandStep . CHANGELOG_FILE_ARG , changeLogFilePath)
266+ commandScope. addArgumentValue(PreCompareCommandStep . COMPARE_CONTROL_ARG , compareControl)
267+ commandScope. addArgumentValue(DiffOutputControlCommandStep . INCLUDE_CATALOG_ARG , true )
268+ commandScope. addArgumentValue(DiffOutputControlCommandStep . INCLUDE_SCHEMA_ARG , true )
269+ commandScope. addArgumentValue(DiffOutputControlCommandStep . INCLUDE_TABLESPACE_ARG , true )
260270 commandScope. setOutput(System . out)
261271 commandScope. execute()
262272 }
0 commit comments