-
Notifications
You must be signed in to change notification settings - Fork 28
[Proposal] Make the migrations atomic #1970
Comments
This is already done automatically via For further complication, i.e. regarding MySQL, see e.g. #1645 |
I've always been a victim of this flow. Thanks for proposing. |
Changing a database table in some way - adding/modifying/deleting a column is rarely supported inside a transaction. It's definitely not supported with MySQL which I imagine most of us are using. The way to control this is by having unit migrations - one migration, one change. Need a column with an index attached to it - have two migrations created - one for the column and another one for the index. |
For now the migrations don't run in atomic way. Means that if you have the following code, first it creates table, then columns and if everything goes fine, then create the index. Now if you have any problem like duplicate index name or anything that prevents the migration from creating the
index
, on next run - after correcting the problem - you will get error `Table 'xyz' already exists.But if the creation of table and other after creation processes become atomic this problem won't happen.
Do you think it's ok that we have this feature, or atleast have it as an option on command?
The text was updated successfully, but these errors were encountered: