How To: Remove abandonded changes from Liquibase Enterprise and lower environments



This document describes how to permanently remove changes from Datical and from lower environments that were abandoned.

Clean Lower Environments

In order to remove abandoned changes from lower environments, you would need to apply the "fix" script to those environments. In order to control where to deploy your "fix" script, you can use "contexts" in Datical. Follow the steps described in How To: Abandon changes in order to remove your changes. This would effectively clean your environments from abandoned changesets. 

Where Are Changesets Referenced?

Changesets that you label as "abandoned" reside in the changelog.xml file in your Datical project.

In general, these changesets are referenced in multiple places:

  • Datical project repository in SCM
    • Changelog directory (in changelog.xml) as indicated above
    • Resource directory (scripts associated with the changeset or referenced in the changeset)
  • SQL code repository in SCM (scripts originating in the "ddl", "ddl_direct", "data_dml", "sql", sql_direct" folders are referenced in the "archive" directory)
  • Tracking table (DATABASECHANGELOG) in each database environment where those changesets got deployed.
  • Audit database 

Primary Process

Although abandoned changes can be removed (or fixed) from database environments, it should be noted that abandoned changesets SHOULD NOT BE removed from the Datical project. Those changesets are safe to remain in the Datical project. These changesets serve as evidence of changes that Datical packaged, deployed and abandoned over time. As such, entries logged in tracking table (DATABASECHANGELOG) and audit database also serve to provide audit trail of such changes. 

What will happen if you delete abandoned changesets from your Datical project

As indicated above, there are multiple traces of abandoned changesets. If you delete those changesets from your Datical project (from changelog.xml file), then because those changesets are still referenced in multiple places, your deleted changesets will continue to show when you Status your database environment (as ignored changesets). 

Alternate Process

In the event that a changeset must absolutely needs to be deleted from changelog.xml, this activity can only be done using Datical GUI. As such, it should be noted that this would be a manual task and could impact release automation platform if not done correctly. Therefore, this path should be taken very rarely and with great caution. Typically, this task would be performed after a release has been pushed to PROD.

You will need to make sure that your Datical project is connected to your SCM and that you are working on the latest version of your project.

  1. In Datical GUI, get the latest version of the Datical project from SCM. E.g., "git pull"
  2. Click on the "Design" tab (near the bottom). 
    1.  → 
  3. In the Design view, select the changeset you want to delete. Then right-click and select Remove.
  4. VERY IMPORTANT: Your project is now in an unsaved state. This is indicated by the * in the view. Save your project by going to the File menu and select "Save". Or you can use Ctrl+S shortcut key from your keyboard
  5. Now, when you Status your database and look at what's deployed in your database, you will notice that the deleted changeset shows up in the Ignored view with comments "Not in Changelog"
  6. VERY IMPORTANT: Commit and push your Datical project back into SCM because your changelog.xml file has changed.
    1. For example, "git commit ..." followed by "git push".



Copyright © Datical 2012-2020 - Proprietary and Confidential