rollbackCountSQL <value> command

The rollbackCountSQL <value> command is a helper command that allows you to inspect the SQL Liquibase will run while using the rollbackCount <value> command.

Uses

The rollbackCountSQL <value> command is used when you want to inspect the raw SQL before running the rollbackCount <value> command, so you can correct any issues that may arise before running the command. Liquibase uses the raw SQL to revert any changesets between the most recent and the value you specified.

Running the rollbackCountSQL <value> command

Before running the rollbackCountSQL <value> command, you can run the history command to see all your previously executed changes.

Note: RollbackCountSQL <value> works from the bottom of the list towards the top. Also, unlike the rollbackCount <value> command, there is no impact of this command. See the rollbackCount <value> topic for more information.

To run the rollbackCountSQL <value> 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 rollbackCountSQL <value> command:

liquibase –changeLogFile=mychangelog.postgresql.sql rollbackCountSQL 1

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

rollbackCountSQL <value> global attributes

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

* Liquibase checks the changelog and any nested changelogs for the definitions of the changesets to roll back.

* * If not specified, rollbackCount SQL output goes to STDOUT.

rollbackCountSQL <value> Command attributes

Attribute Definition Requirement
--value The integer indicating the number of changes you want to rollback Required