We are using Liquibase in a highly modular application. Until today we put all changelogs for the whole application into .xml files and structured them like it is described in the best practices.
In future we want to put the changelogs into the corresponding modules. So it would be possible to execute only those changes which exist in the deployment scenario. Is there a way to do that? We´ve tried a solution with the includeAll property, but its not possible to include multiple directories with the same name in different jars. Our idea was to use a structure like that:
- liquibase module
- org/example/liquibase/master.xml
- <includeAll path="META-INF/liquibase" />
- module 1
- META-INF/liquibase/module1.xml
- < include file = "org/example/module1/liquibase/master.xml" />
- org/example/module1/liquibase/master.xml
- < includeAll path = "org/example/module1/liquibase/r0.12" />
- < includeAll path = "org/example/module1/liquibase/r0.13" />
- org/example/module1/liquibase/r0.12/2012-12-01-test.xml
- org/example/module1/liquibase/r0.12/2012-12-01-test2.xml
- org/example/module1/liquibase/r0.13/2012-12-09-test.xml
- org/example/module1/liquibase/r0.13/2012-12-10-test.xml
- ... further changes of this module
- module 2
- META-INF/liquibase/module2.xml
- < include file = "org/example/module2/liquibase/master.xml" />
- org/example/module2/liquibase/master.xml
- < includeAll path = "org/example/module2/liquibase/r0.12" />
- < includeAll path = "org/example/module2/liquibase/r0.13" />
- org/example/module2/liquibase/r0.12/2012-12-01-test.xml
- org/example/module2/liquibase/r0.12/2012-12-03-test.xml
- org/example/module2/liquibase/r0.13/2012-12-08-test.xml
- org/example/module2/liquibase/r0.13/2012-12-10-test.xml
- ... further changes of this module
The current implementation is not supporting a structure like that, because the classpath scanning and the sorting of the changelogs by naming conventions is not possible and its hard to extend the current implementation.
So it woud be interesting if there is a way to realize a modular changelog execution or if this is a completely wrong approach?
Thanks
Andreas