'Is there a way to include whole folder with changelogs in Liquibase db versioning?
I have a problem with Liquibase database versioning, because I want to include all changelog files in folder, without specifing its names and do update using them. Is that possible? My structure:
db--
|
--release-v1
|
--fistchangelog.sql
--secondchangelog.sql
|
--release-v2
|
--newchangelog.sql
...
And with every release I want to use all *.sql files from its folder. I don't want to hardcode names of sql files. I use only liquibase command lines for CI/CD in Azure.
I found something like (liquibase.org/get-started/best-practices), but it only works with xml files and I use sql extension.
I have one idea but it seems bad for me and I ll use it as a last resort. Just making a loop, for every file in folder, in cmd...
Does someone know is there a simpler and better way?
Solution 1:[1]
i think you should just use "includeAll" tag. Then liquibase will execute all .sql files inside the folder. but remember that if you not specifying every single file, Liquibase will execute those files in alphabetical order. Sth like:
<includeAll path="com/example/changelogs/"/>
Read here -> https://docs.liquibase.com/concepts/changelogs/attributes/includeall.html
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | rgrzegorczyk |
