Simplified icon of a target above code syntax

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 the rollback-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 the rollback-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

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

Blogs and Articles