Packaging Liquibase changelogs is a separate process from packaging SQL files. They may be placed only in flexible folders. There is no fixed-folder name or processing for Liquibase changelogs.
Changelog File Requirements
Place the changelog files in a folder in your sql_code repository.
- Must be in a separate folder from SQL folders
- The folder itself can be named anything you want. The folder name
changelog
is used in examples. - The files must consist of only complete changelogs.
- The file must have an author.
- Changesets must have globally unique IDs
Changelog Content Restrictions
The changesets in changelog files may not include the following
- External file references
- Liquibase preconditions
- Liquibase extensions
Properties for Changelogs
The following properties in metadata.properties
must be set in a folder that contains only changelogs.
packageMethod=changelog
rerunnable=false
Processing halts and reports errors if these conditions are not met.
Processing
During processing, the Liquibase changesets are transformed to Datical changesets.
Properties Set
The following attributes are added and set for the changelog and its changesets.
- datical:version (initially 1)
- datical:versionStrategy (DEPLOY_ALL)
- datical:origFilePath
- datical:origFileName
Additional properties are set during processing:
- Labels and contexts set in metadata.properties
- Commit messages from source control
File Handling
The changelog XML files are copied to the Resources folder for the project.
After processing, the changelog XML files are moved to the Archive folder for the project.
Developer Workflows
You can package developer workflow scripts alongside the original changelog to manage workflow for its packaged changesets.
Supported
Ignore - add a an ignore file to prevent the packaged changesets from being deployed.
<original-filename>-ignore.xml
Cleanup - add an XML changelog to reverse database changes caused by packaging a changelog. The cleanup changelog must account for all changes made by the original changelog.
<original-filename>-cleanup.xml
Replace - add a replacement changelog to replace the original changelog.
<original-filename>-replace.xml
Not Supported
- Rollback - do not add a rollback file for Liquibase changelog. If a rollback file is found, packaging stops and exits with an error.
See Developer Workflows: Managing Changesets During Development and Test.