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:
- Missing objects in one or more of the databases that actually need to be there
- Extraneous objects in one of the databases that needs to be removed
- Changes to objects that are intended (or not)
- Duplicate changesets (occasionally generated by the baseline)
- 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.
- To review the changes, open your project
- Click on the Design tab
- 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.
- Open a changeset to see more details. Click the triangle to the left of it.
- 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:
- EITHER THIS: Remove the object and rebaseline.
- Remove the object from the TT database
- Re-baseline after reviewing the rest of the needs_review changes in the changelog
- OR THIS: Update the label so the changeset will be IGNORED and not deployable in the any of the pipelines.
- Remove the needs_review and <pipeline_label> labels
- 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
- EITHER THIS: Add the object and rebaseline.
- Add the object to the TT database
- Re-baseline after reviewing the rest of the needs_review changes in the changelog
- OR THIS: Update the label so the changeset will be IGNORED and not deployable in the any of the pipelines.
- Remove the needs_review and <pipeline_label> labels
- 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
- EITHER THIS: Correct the object and rebaseline.
- Correct the object in the TT database
- Re-baseline after reviewing the rest of the needs_review changes in the changelog
- OR THIS: Update the label so the changeset will be IGNORED and not deployable in the any of the pipelines.
- Remove the needs_review and <pipeline_label> labels
- 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.
- Click the link under the Production Database's Database Icon (in this case it says Partially Deployed)
- Scroll down until you see changesets with needs_review as part of their label
- Select the desired changesets by checking each checkbox next to the appropriate changesets and click the Remove Labels button.
- Double-click the needs_review label in the left column (it will move to the right) and click Next.
- Review the changes and click Finish
- 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