We are using Liquibase for this project I'm working on right now, and all the changelogs are in one big XML-file. Unfortunately, this file has gotten WAY too big - and we want to introduce a "master" file, that includes the original file and any new ones.
The old structure:
/db/changesets-from-beginning-of-time.xml
The new structure:
/db/changesets/changesets-from-beginning-of-time.xml
/db/changesets/changesets-v.1.2.3.xml
/db/changesets/changeset-master.xml
The content of the changesets-*
-files are simply changeset xml, while the changeset-master.xml
file looks like this:
<databaseChangeLog xmlns="...skipped...">
<include file="changesets-from-beginning-of-time.xml"
relativeToChangelogFile="true"/>
<include file="changesets-v1.2.3.xml"
relativeToChangelogFile="true"/>
</databaseChangeLog>
Now, the DATABASECHANGELOG
table in my database references the old files, and thus the old changesets are run again.
According to the Liquibase documentation, each changeset is uniquely identified by the combination [filepath/-name]:::[id]:::[author]
- which is less than optimal for me.
So my question is - how do I refactor the file structure without breaking my liquibase setup and emptying my database?