rollbackSQL <tag> command

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


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, type the following into your command line:

liquibase --changeLogFile=postgres_lbpro_master_changelog.xml rollbackSQL myTag

Note: Replace postgres_lbpro_master_changelog.xml with the name of your changelog and myTag with the name of your tag used in your rollback command.

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.