Discussion:
[Liquibase-user] New Topic: idea : new tag "test" inside "changeSet"
Liquibase Community Forum
2010-12-16 22:38:13 UTC
Permalink
A new topic, 'idea : new tag "test" inside "changeSet"', has been made on a board you are watching.

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

The text of the topic is shown below:

because the databasechangelog table can be manipulated from outside liquibase environement. I faced a situation where the changeSet entry is there in databasechangelog table but the changes are not applied to the schema.
To handle such issues i think it will be a very useful feature to add a <test> element along with the rollback inside the <changeSet> this test element can have a sql with other conditional operators (as in preCondition) which would determine that the changeSet is actually applied on the database or not.
This will also help the users in identifying the changeSets which have been invalidated and needs cleanup.

the tag would look like
<changeSet>
<sql>alter table emp add column DEPT_NO</sql>
<test>select DEPT_NO from emp</test>
</changeSet>

in case the column DEPT_NO was renamed to DEPT_ID by some later changeset then the test for the above changeSet would fail and the user can either remove this changeset or merge it with the new one

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...