Applies to
- Liquibase Enterprise (Datical DB)
Summary
In scenarios where database scripts have been manually deployed to higher environments outside of Liquibase’s management, it’s crucial to prevent these changesets from being reapplied during automated deployments to maintain database integrity and avoid potential conflicts. By marking these changesets with the ignore attribute set to true, Liquibase treats them as non-existent during deployment processes, ensuring that manually applied changes are not redundantly executed. This approach maintains consistency across environments and leverages Liquibase’s tracking capabilities to manage database changes effectively.
Environment Conditions
- Any version of Liquibase Enterprise
How to ignore a changeset
Step 1: Identify the Changeset File
Determine the exact filename of the changeset you want to ignore. For example, if the changeset is in a file named mychanges.sql.
Step 2: Create an Ignore File
In the same directory as the mychanges.sql file, create a new blank (zero-length) file with one of the following naming conventions:
- mychanges-ignore.sql
- mychanges_ignore.sql
This “ignore” file signals Liquibase Enterprise to abandon the associated changeset during deployment.
Step 3: Process the Ignore File
When the Deployment Packager processes the files during packaging, it will:
- Search the changelog for matching changesets based on attributes like datical:origFilePath, datical:origFileName, and the highest datical:version number.
- Set the ignore attribute to true on all matching changesets.
- Archive the “ignore” file.
Note: If the “ignore” file is not zero-length, packaging will stop with an error.
Restoring Ignored Changesets:
If you need to restore a previously ignored changeset, create a blank “unignore” file in the same directory with one of the following names:
- mychanges-unignore.sql
- mychanges_unignore.sql
This will remove the ignore attribute from the matching changesets, making them eligible for deployment again.
Comments
0 comments
Article is closed for comments.