-
-
Notifications
You must be signed in to change notification settings - Fork 529
Description
This is intentionally a reopening of sequelize/sequelize#1882 which was closed automatically by a bot. I think it's a fundamental feature for a migration engine.
What you are doing?
There was a problem applying a migration, due to a issue in the code of the migrations.
What do you expect to happen?
I expect the whole migration to be rolled back.
Nearly all database engines support DDL in transactions. It should be the default way updates are done, unless the user chooses not to.
Even if the database does not fully support transactions for DDL (MySQL) sometimes migrations can make updates to data e.g. adding records to lookup tables, and it should be the default to roll these back.
What is actually happening?
The database ends up in an inconsistent state, with half the changes of the migration applied, but not the other half. I can't re-run the migration, I can't easily go back. I have to manually finish the migration and then manually update the meta tables.