Discussion:
[Liquibase-user] New Topic: updateDatabase, modify <sql> in one of the changeSets and updateDatabase again.
Liquibase Community Forum
2010-10-08 07:45:12 UTC
Permalink
A new topic, 'updateDatabase, modify <sql> in one of the changeSets and updateDatabase again.', has been made on a board you are watching.

You can see it at
http://liquibase.org/forum/index.php?topic=736.new#new

The text of the topic is shown below:

Hi,

Imagine this use case.
I have 1 changeSet in a change-log.xml file that has an <sql></sql> and a <rollback></rollback> 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?

Unsubscribe to new topics from this board by clicking here: http://liquibase.org/forum/index.php?action=notifyboard;board=1.0

Regards,
The Liquibase Community Forum Team.

Loading...