Applies to
- Liquibase Secure (Pro)
Issue Description
When using the 'generate-changelog' command in Liquibase, some users need to create individual files for each database object, including tables. This organizational structure is especially important when establishing a baseline for existing projects being migrated to Liquibase, as it allows teams to maintain a clear history log for each object as changes are made over time.
Previously, Liquibase did not support generating separate files for each table or database object when running the 'generate-changelog' or 'diff-changelog' commands. While the command would create a main changelog and an "objects" folder with specific changelogs for certain object types (like foreign keys, views, etc.), it did not provide the ability to create individual files per table.
Note: When generating changelogs in SQL format, Liquibase does not create an "objects" directory at all. This behavior is by design, as the objects folder structure is only available when using other changelog formats (such as XML, YAML, or JSON).
Solution
This functionality has been implemented and is available starting in Liquibase Secure 5.0 (formerly Liquibase Pro).
New Parameter: object-changelogs
The new --object-changelogs parameter allows you to generate separate files and folders for each database object when using the generate-changelog and diff-changelog commands.
This parameter is available for:
- generate-changelog command
- diff-changelog command
How to Use
Add the --object-changelogs parameter to your command:
liquibase <command> --object-changelogs=allValid values:
-
all(generate changelogs for all object types) -
table(generate only for tables) -
view(generate only for views) -
dml(generate only for DML changes) none
Default value:
none
Additional Resources
- Liquibase Secure 5.0 Release Notes
- generate-changelog Command Documentation
- diff-changelog Command Documentation
Upgrading to Liquibase Secure 5.0
If you're upgrading to Liquibase Secure 5.0 to access this feature, note the following important changes documented in New Distribution Channels for Liquibase Secure 5.0.
Comments
0 comments
Article is closed for comments.