Targeted Rollbacks
Targeted rollbacks provide users the ability to target the exact changeset or deployment update for rollback without rolling back all the changes that came after.
Targeted rollback commands leave unrelated changes to the product and customer tables in place and remove the changeset record from the DATABASECHANGELOG table. Rollback history is retained in the DATABASECHANGELOGHISTORY table.
Targeted Rollback Commands
These commands require an active Liquibase Pro license:
rollback-one-changeset
: used to revert a single change without impact to changes made before or after the targeted change.rollback-one-changeset-sql
: executed before therollback-one-changeset
command to inspect the raw SQL for potential issues.rollback-one-update
: used to revert all changes that were applied to the database related to a specific deployment ID.rollback-one-update-sql
: executed before therollback-one-update
command to inspect the raw SQL for potential issues.
Each individual targeted rollback command page will specify the criteria for using the command successfully including a list of required and optional command-specific arguments.
Warning: Because data is constantly changing, there is a risk of data loss when a rollback is executed. There is also a risk of database drift if the rollback is not executed in all impacted database environments.
Targeted Rollback Command Requirements
All targeted rollback commands require the following command arguments:
- The root changelog file is specified as
--changelog-file
. - The JDBC database connection URL is specified as
--url
.
The username and password are not required for connections and systems which use alternate means of authentication.
Troubleshooting
If an error is returned when executing a targeted rollback command, use the Liquibase --help
parameter to check the correct syntax of the command and the command-specific parameters that can be used when executing the command.
For example, in the CLI:
liquibase <command> --help
Related Content
- Visit the Using JDBC URL in Liquibase documentation page to learn more about Liquibase database connection requirements.
Liquibase Resources
Liquibase Help
- Visit the Liquibase Forum channel to ask questions, find answers from other Liquibase users, and learn about new Liquibase version releases.
- Visit the Liquibase Support Portal for Liquibase Pro assistance and troubleshooting tips.
Tutorials
- Visit the Liquibase Rollback Workflow documentation page to learn more about validating and creating rollback statements.
Blogs and Articles
- Database Rollback or Fix Forward?: read the blog about the common approaches to database issues and why a fix forward may be the right approach for you.
- Introducing Targeted Rollback for One Change: read the blog to learn more about this Liquibase Pro command.
- Introducing Targeted Rollback for One Update: read the blog to learn more about this Liquibase Pro command.