rollbackSQL <tag> command

The rollbackSQL <tag> is a helper command that produces the raw SQL Liquibase would run when using the rollback<tag> command.

Uses

The rollbackSQL <tag> command is typically used to inspect the SQL Liquibase uses to revert changes associated with a tag you specify when you run the rollback <tag> command. It is best practice to use the rollbackSQL <tag> command before running the rollback <tag> command to ensure that you eliminate any potential risks.

Running the rollbackSQL <tag> command

To run the rollbackSQL <tag> 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 rollbackSQL <tag> command:

liquibase --changeLogFile=postgres_lbpro_master_changelog.xml rollbackSQL myTag

Note: Enter the name of the changelog and tag that you want to use in place of postgres_lbpro_master_changelog.xml and myTag.

rollbackSQL <tag> 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 rollback will be written Optional

* Liquibase checks nested changelogs for definitions of the changesets to rollback.

**If not specified, rollbackSQL <tag> output goes to STDOUT.