2

Resolved

An exception thrown from a migration step doesn't fail the whole migration

description

I.e. if an exception is thrown from a migration step then the schema alteration to that point actually persists. E.g. if there is a table creation, then an exception is thrown (that bubbles up from the migration step) the table will be created but naturally everything else later on not and the corresponding DataMigrationRecord is not created.
This results in an incomplete migration that can only be resumed by manually editing the DB schema or data (depending on the content of the migration). (Because e.g. if a table is created, then an exception is thrown but later the exception is fixed then the migration won't be able to run as the table was already created...)
In my opinion migrations should fail in the same way transactions are rolled back per request: if something fails, everything fails.

comments

AimOrchard wrote Apr 5, 2013 at 11:49 AM

Yeah we run into this multiple times, annoying while developing :/

sebastienros wrote May 14, 2013 at 1:17 AM

Fixed in changeset 847c3d59d6be

sfmskywalker wrote Mar 28 at 1:28 AM

Fixed in changeset fb7ab626d587acf4266343cfc0ca1fb2b30bfb02