Replace 'changeLog' with 'changeLogs' and map Strings to ResourceFactory
andrus opened this issue · 0 comments
andrus commented
We are doing 2 things here , combined in one task:
- Adding support for multiple change logs in YAML, which potentially allows to cut down on the number of Liquibase "index" files, as the top-level change log can be described directly in BQ config. Also opens the door for handling modularity along the lines of #10.
- Replacing Liquibase algorithm for resolving Strings to files with ResourceFactory, so that file paths are handled the same way as they are in other places in Bootique.
Upgrade Notes
'liquibase.changeLog' YAML config property is deprecated, but still supported. When migrating to 'changeLogs', ensure that you rewrite the paths to follow BQ ResourceFactory approach. Specifically, if the resource is on classpath, it needs to have "classpath:" prefix. Otherwise it will be treated as a file path. E.g.:
jdbc:
test:
url: jdbc:derby:target/derby/migrations1;create=true
driver: org.apache.derby.jdbc.EmbeddedDriver
maxActive: 2
liquibase:
datasource: test
changeLogs:
- classpath:io/bootique/liquibase/changelog_1_2.yml
Same goes for files imported from Liquibase XML or YAML files. "relativeToChangelogFile" property in those is still supported. E.g.:
databaseChangeLog:
- include:
file: classpath:io/bootique/liquibase/changeset1.sql
relativeToChangelogFile: false
- include:
file: changeset2.sql
relativeToChangelogFile: true