0

I would like to insert a <rollback/> element in each of multiple <update> elements in a <changeSet>. As opposed to having a single <rollback/> element for the entire <changeSet>. Will this work? Or is the context of a <rollback/> element the entire <changeSet> transaction only?

I am assuming if this works, the <rollback> occurs outside the <update>, following each </update>?

Chuck Herrick
  • 63
  • 1
  • 9

1 Answers1

1

You can only have a single rollback block per changeSet. You cannot have individual ones per update block.

Liquibase does not track the individual updates, only the changeSet and so there is not way to specify particular parts of a changeSet to roll back.

You can have multiple <update> or <sql> blocks inside your <rollback> tag, but only one rollback tag

Nathan Voxland
  • 15,453
  • 2
  • 48
  • 64
  • Just a reminder: the rollback is for after the changeSet has been successfully executed and you later want to undo it. If the changeSet fails, Liquibase will rollback the transaction using the database's standard rollback support and will revert any update statements that had successfully ran. – Nathan Voxland Feb 19 '14 at 20:36