Contributing change logs via DI
andrus opened this issue · comments
For database modularity we need migrations to come with modules. So a migration changeset would be built dynamically based on the runtime module collection. We will add a LiquibaseModule.contributeChangeLogs
method that will allow to gather a set of module changelogs that will be merged with changelog from YAML and executed by Liquibase.
Changelog Ordering
The ordering of migrations will be non-deterministic and hence by default limited to schemas that don't have relationships between tables belonging to each module. We will add an injectable service that orders available change logs. By overriding this service, you can get access to the full change log collection and can do ordering dynamically. Also using "changeLogs" property in YAML will result in ignoring DI-contributed change logs and will allow for explicit ordering.
In the future we can implement an ordering algorithm based on cross-module dependency analysis.
DI vs YAML
I guess if change logs are set in YAML, we will ignore DI-contributed logs, which is kind of consistent with how Bootique merges collections in other places, by replacing the entire collection.