Reputation: 570
We are using liquibase to split a column into two columns. This happens in three changes:
This works great, but I can not find any documentation on the order of execution of changes. I only found documentation on the order of execution of changeSets, see here.
Does liquibase guarantee, that the changes are executed sequentially in the order that they appear?
Upvotes: 4
Views: 2818
Reputation: 7330
I've never saw any documentation about it, but in my experience - it does execute changes inside the changeSet sequentially in the order they appear.
Also, I don't think it's good practice to put all the above changes into one changeSet
, because, as stated in the document you've provided:
Liquibase attempts to execute each changeSet in a transaction that is committed at the end, or rolled back if there is an error. Some databases will auto-commit statements which interferes with this transaction setup and could lead to an unexpected database state. Therefore, it is usually best to have just one change per changeSet unless there is a group of non-auto-committing changes that you want applied as a transaction such as inserting data.
I suggest separating your changeSet
into three atomic ones with appropriate preConditions
, or create a proper rollback
for it.
Upvotes: 4