How to deal with failing changesets in Oracle

Hi,

I have a question on how others deal with changeset that fail during execution with DBMS that do not support transactional DDL.

When I have a changeSet with e.g. more than one statement in it, and it fails half way through the database is partially changed in Oracle, but the changeSet is not marked as applied (which is correct). But I cannot fix the reason for the failing and re-run the changeSet as the statements that were successful will now cause an error (because e.g. the new column is now there)

The best option is to have one DDL change per changeset.  That way it either succeeds or it doesn’t with no half-worked state.  If you are doing insert, update, or other transactional changes it is fine to have as many of them in a changeset as you like.

Nathan 

Originally posted by: Nathan
The best option is to have one DDL change per changeset.  That way it either succeeds or it doesn't with no half-worked state.  If you are doing insert, update, or other transactional changes it is fine to have as many of them in a changeset as you like.
Thanks for the answer, that's what I will do now.

Would it help to supply a rollback tag? Would liquibase run the rollback if an error occurred?

No, the rollback tag is only for when you use the rollback command to either specify the rollback sql for changes that can’t generate it automatically or to override the default rollback sql.

Liquibase assumes that if something fails, everything will roll back.  It is too easy to get into even worse places otherwise.

Nathan