Imagine this use case.
I have 1 changeSet in a change-log.xml file that has an and a with sql inside too. (this is the approach we are talking as some of the people who write the DDL are pure PL/SQL developers and are not so much into xml files. They write the update and rollback scripts, pass them onto me and i add them to change-log.xml.
I run update the database with this changeSet in change-log.xml,
Little later they realised they wanted to change something and they get back to me with the modified SQL and the modified rollback SQL too.
If i change it in change-log.xml and I do run updateDatabase again. (even with runOnChange = true) it will not work.
For such functionality to work, liquibase would have to rollback the first implementation of the changeSet but at that time the content of the rollback tag of that changeSet has also changed.
Nathan, what about this:
We add another column to the database changelog that keeps the neccesart sql to rollback.
If a changeSet changes and runOnChange=“true”, we use the rollback script in databaseChangeLog. Then we run the new sql in the modified change-log.xml.
Wouldn’t this be convenient?
Right now, when I find myself in this scenario, I have to first do a rollBackDatabase, modify change-log,xml and updateDatabase again. If I have different environments (which most people do) I have to do this in all environments in which i had run the changeSet once.
What do you think?