|
|
|
|
|
by junto
766 days ago
|
|
Microsoft SQL Server has a similar issue but also similarly when adding a new column to a table, which I found out by accident when trying to deploy a migration that had worked fine in our non-production environment stages. Adding the column as not nullable and setting a default is the absolute killer. A work around when you still want to have a default is to do a three pass migration. First add the column as nullable and no default, then run an update to set the default on all rows, and finally change it to not nullable and set the default constraint. It has a surprising difference in speed. |
|