Liquibase Enterprise was formerly known as Datical DB.

Review Baseline

Once the project baseline is complete, you need to review the results. It's normal to find inconsistencies among databases the first time you execute the baseline. This is your opportunity to figure out what needs to be addressed and get the databases cleaned up. Once you have them all cleaned up, you will need to re-run the baseline on the updated databases.


What to Expect After Running the Baseline Script

The baseline script will generate changes between each pair of databases in the pipeline, and it will label these detected differences with:


  • Default Label (from connection information)
  • DbDef Name
  • "needs_review"

This step often uncover inconsistencies among the databases. It is normal to see objects that are supposed to have been deleted long ago, or objects that were deployed to one environment and not to the others.
By running the baseline, you are now seeing things that were previously hidden from your view. Now that you can see them, this is your opportunity to get these inconsistencies cleaned up.
After baselining, the DBA needs to review the needs_review changes and determine if they are:

  1. Missing objects in one or more of the databases that actually need to be there
  2. Extraneous objects in one of the databases that needs to be removed
  3. Changes to objects that are intended (or not)
  4. Duplicate changesets (occasionally generated by the baseline)
  5. Storage option related changes that are captured when managing storage options is not desired (managing storage options in Datical is optional and can be enabled/disabled before running the baseline)

Here are the typical situations you will encounter:

  • Changesets are correct – label them so they can be promoted easily
  • Changesets were generated from missing objects in one of the earlier DBs that are in a later DB – these need to be added to the earlier DBs (or removed from the later DB)
  • Changesets were generated from extra objects in one of the later DBs that are missing from earlier DBs – these need to be removed from the later DBs (or added to the earlier DBs)
  • Changesets were generated due to Storage Option differences – either fix the differences in the DBs or ignore these changesets (managing storage options in Datical is optional and can be enabled/disabled before running the baseline)
  • Changesets were generated that duplicate changesets captured in another pipeline – ignore these changesets

The 3 types of changes that can get created are drop, modify and create. The following discussion explains what to look for when validating each of these changesets.

Reviewing Changesets in Datical DB

For this example project, the Pipeline is: DEV >> REF >> SIT >> TT >> PROD. In the screenshot below, we're looking at the differences between TT and PROD. Any differences will be marked with the <pipeline label>, TT and needs_review.

  1. To review the changes, open your project
  2. Click on the Design tab
  3. Scroll down until you see changesets with the needs_review label and visually review the changesets generated for a specific database (in this case, TT).
    • Open a changeset to see more details. Click the triangle to the left of it. 
       
  4. In this example, for each changeset marked as needs_review and TT, you need to determine the following and take the appropriate action. (The changes marked as TT are the results from the comparison between TT and PROD) 

Review the list of changesets and determine what action to take for each. 

When you see a CREATE, it means that this object is in TT but is missing from PROD

  • If the object is missing from PROD because it hasn't been deployed there but should be, then remove the needs_review label. The Create is ready to deploy to PROD when needed.
  • If the object is missing from PROD because it is an old object that was supposed to have been dropped from TT in the past but got missed, then:
  1. EITHER THIS: Remove the object and rebaseline.
    1. Remove the object from the TT database
    2. Re-baseline after reviewing the rest of the needs_review changes in the changelog
  2. OR THIS: Update the label so the changeset will be IGNORED and not deployable in the any of the pipelines.
    1. Remove the needs_review and <pipeline_label> labels
    2. Add a label called ignore

When you see a DROP, it means that this object is in PROD but is missing from TT

  • If the object is missing from TT because the object is no longer needed by the application, then remove the needs_review label. The Drop is ready to deploy to PROD when needed.
  • If the object is missing from TT because it was deployed in PROD but never got deployed back to earlier environments, then
  1. EITHER THIS: Add the object and rebaseline.
    1. Add the object to the TT database
    2. Re-baseline after reviewing the rest of the needs_review changes in the changelog
  2. OR THIS: Update the label so the changeset will be IGNORED and not deployable in the any of the pipelines.
    1. Remove the needs_review and <pipeline_label> labels
    2. Add a label called ignore

When you see a MODIFY, it means that this object is in both TT and PROD, but it has changed.

  • If the change is expected, then remove the needs_review label. The Modify is ready to deploy to PROD when needed.
  • If the change is unexpected, then
  1. EITHER THIS: Correct the object and rebaseline.
    1. Correct the object in the TT database
    2. Re-baseline after reviewing the rest of the needs_review changes in the changelog
  2. OR THIS: Update the label so the changeset will be IGNORED and not deployable in the any of the pipelines.
    1. Remove the needs_review and <pipeline_label> labels
    2. Add a label called ignore

Re-Baseline, if Database Changes Were Made

If you made any changes to any of the databases during the review stage, re-run the baseline step, delete the current project and re-import the re-baselined project into Datical so it can be re-reviewed.

How to Remove Labels

As part of the process above, you will need to modify the labels as you process the changesets. Below is an example of removing the needs_review label from a group of changesets.

  1. Click the link under the Production Database's Database Icon (in this case it says Partially Deployed)



  2. Scroll down until you see changesets with needs_review as part of their label



  3. Select the desired changesets by checking each checkbox next to the appropriate changesets and click the Remove Labels button.



  4. Double-click the needs_review label in the left column (it will move to the right) and click Next.



  5. Review the changes and click Finish



  6. The needs_review label has been removed from the selected changesets

The changes are now available to propagate through the pipeline.



Copyright © Liquibase 2012-2022 - Proprietary and Confidential