9.12.31 rollback-to-date

Roll back changes made to the database back to the specified date and time.

Syntax

Liquibase|lb rollback-to-date|rbtd {OPTIONS}

The rollback-to-date command is used to revert changes from today's date to the specified date and time..

Options

Option Description Default
Required
-changelog-file|-chf The root changelog file. -
-date|-da [ Date to use when determining what changes to apply. The date format is YYYY-MM-DD HH:MM:SS. If including time, enclose the entire date/time in double quotes. -
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).

-
-rollback-script|-ros Rollback script to execute. -
-search-path|-sep

Complete list of locations to search for files such as changelog files.

You can 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.

True
-output-default-schema|-ouds Controls whether names of objects in the default schema are fully qualified or not. If false, only objects outside the default schema are fully qualified. False

Example

Roll back to the specified date and time.

-- Set default output path
SQL> cd <output-files-path>
-- Connect to target
SQL> connect <db-connect-string>
-- Apply update update on 2022-09-01
SQL> lb update -changelog-file controller.xml
-- Apply update on 2022-09-02
SQL> lb update -changelog-file controller.xml
-- Apply update on 2022-09-03
SQL> lb update -changelog-file controller.xml
-- Roll back to version1
SQL> lb rollback-to-date -date 2022-09-02 -changelog-file controller.xml