9.12.29 rollback-count-sql

Generate the SQL to roll back the specified number of changes.

Syntax

Liquibase|lb rollback-count-sql|rbcs {OPTIONS}

The rollback-count command is used to revert the specified number of changes to the database starting from the most recent changes.

Options

Option Description Default
Required
-changelog-file|-chf The root changelog file. -
-count|-cu The number of changes to apply. -
Optional
-contexts|-co Context string to use for filtering which changes to operate on. -
-database-changelog-table-name|-dactn Name of table to use for tracking change history. -
-debug|-de Enable debug output. -
-default-schema-name|-desn The default schema name to use for the database connection. -
-defaults-file|-def Fully qualified path to the properties file you want to use. Example: -defaults-file/tmp/liquibase.properties -
-labels|-la Label expression to use for filtering the changes to operate on. -
-liquibase-schema-name|-lbsn Schema to use for Liquibase objects. -
-liquibase-tablespace-name|-lbtn Tablespace to use for Liquibase objects. -
-log|-lo

Enable logging.

Standard logging is INFO level (no debug flag).

Debug logging is FINEST level (both log and debug flag).

-
-output-default-schema|-ouds Control whether names of objects in the default schema are fully qualified or not. If true they are qualified. If false, only objects outside the default schema are fully qualified. False
-output-file|-ouf The name of the file to write the output to. -
-overwrite-files|-ovf Overwrite any existing files in the directory. This will not affect other files. -
-rollback-script|-ros Rollback script to execute. -
-search-path|-sep <search-path> Complete list of locations to search for files such as changelog files in. Specify multiple paths by separating them with commas. -
-secure-parsing|-scp

If true, remove functionality from file parsers that could be used insecurely.

An example is disabling remote XML entity support.

-

Example

Generate SQL to roll back the specified number of changes.

-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Apply update for versions
SQL> lb update -changelog-file controller.xml
SQL> lb update -changelog-file controller.xml
-- Roll back to version1
SQL> lb rollback-count-sql -count1 -changelog-file controller.xml