Reputation: 1685
We're using Liquibase to handle our DB Schema changes. As we already have quite a large set of ChangeLogs distributed over multiple files, arranged in a complex folder structure, there sometimes rises the need or the desire to make some refactorings that would influence the meta information in the DatabaseChangeLog table.
What is the recommendation for such refactorings? Can I use Liquibase itself to update the DatabaseChangeLog entries or will I run into caching issues?
A simple example to make my case clearer:
Thanks for a feedback!
Some follow up:
Sometimes it's just unfortunate that change sets cannot be adapted. Consider the following case:
Upvotes: 0
Views: 2124
Reputation: 15763
There is no support in Liquibase for refactoring changelog files. It normally expects you to just leave things the way they are once they've been run to minimize unexpected differences.
If you are wanting to move things around, the steps you outlined are what you would need to do. LogicalFilePath will help, and updating the databasechangelog.filename column should be all you need to do.
You will need to update the filename path before you run liquibase the first time after reorganizing the files or it will execute the changeSets again. Liquibase looks at the changelog table and changelog file immediately on startup, so you will need to update the filename column outside of Liquibase.
Upvotes: 2