changelogSyncSQL command

The changelogSyncSQL is a helper command that produces the raw SQL Liquibase would run when using the changelogSync command.


The changelogSyncSQL command is typically used when you want to inspect the SQL Liquibase will use to baseline a new database environment.

It is best practice to inspect any SQL that Liquibase would run when using the changelogSync command so you can review any changes the command would make to your database before running the command.

Running the changelogSyncSQL command

To run the changelogSyncSQL command, you can specify the driver, classpath, and URL in your file. For more information, see Creating and configuring a file. You can also specify these properties in your command line.

Then run the changelogSyncSQL command:

liquibase --changelogFile=mychangelog.postgresql.sql changelogSyncSQL

Note: Enter the name of the changelog that you want to use in place of mychangelog.postgresql.sql.

changelogSyncSQL global attributes

Attribute Definition Requirement
--changeLogFile The root changelog Required
--url The JDBC database connection URL Required
--username The database username Required*
--password The database password Required*
--outputFile* Specifies the file path to where the changelogSync SQL will be written Optional

*If not specified, the changelogSyncSQL output goes to STDOUT.

Note: The username and password attributes are not required for connections and systems which use alternate means of authentication.