Liquibase Rollback Commands

Database works on DDL and DML commands, on execution, these commands will get logged into a log file. once the commit is executed, these logs will update the database in the transaction

SQL provides a ROLLBACK command that reverts or undos the changes performed in transactions which are executed after the last commit but are not persisted in database yet.

Command Description

rollback

 
rollbackSql sequentially rolls back each deployed change till the tag is encountered
rollbackToSate rollbackToDate will revert the executed ChangeSets to the date specified.
rollbackToDateSql rollbackToDateSql helper command lets DBA inspect what SQL query will be executed by Liquibase while reverting back to the date
rollbackCount rollbackCount will sequentially rollback the ChangeSets executed till the number provided in arguments is reached.
rollbackCountSql rollbackCountSql command lets the DBA inspect the row query that will execute while running the rollbackCount command
futureRollbackSql utureRollbackSql helper command, it will provide a rollback script for the ChangeSet which has not been executed yet.
futureRollbackCountSql futureRollbackCountSql will only show SQL the query for the unexecuted ChangeSet for rollback from the last, up to the count provided in the argument.

Let's see all of them one by one

follow us on