"how to tag a changeset in liquibase to rollback" Code Answer


rollback tags are designed to checkpoint your database's configuration.

the following commands will roll the database configuration back by 3 changesets and create a tag called "checkpoint":

mvn liquibase:rollback -dliquibase.rollbackcount=3
mvn liquibase:tag -dliquibase.tag=checkpoint

you can now update the database, and at any stage rollback to that point using the rollback tag:

mvn liquibase:rollback -dliquibase.rollbacktag=checkpoint

or alternatively generate the rollback sql:

mvn liquibase:rollbacksql -dliquibase.rollbacktag=checkpoint

revised example

i initially found it difficult to figure out how to configure the liquibase maven plugin. just in case it helps here's the example i've used.

the liquibase update is configured to run automatically, followed by tagging the database at the current maven revision number.

        <!-- liquibase settings -->

liquibase is now configured as part of the standard life-cycle so can be run as follows:

mvn clean compile
By dau_sama on April 5 2022

Answers related to “how to tag a changeset in liquibase to rollback”

Only authorized users can answer the Search term. Please sign in first, or register a free account.