There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?

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.