changelogSyncSQL command

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

Uses

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 need to specify your driver, class path, URL, and user authentication information in your liquibase.properties file. For more information, see Creating and configuring a liquibase.properties 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

Attributes 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.