You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrap migrations into a transaction, if possible #7641
SQL Server allows modifying the schema in a transaction, which is something our other databases don't let you to do. It adds a certain security though, if we could wrap the whole migration into a transaction, so we might want to implement this for SQL Server.
Maybe we don't want to do this by default because it doesn't scale to very big migrations (presumably, not very familiar with MSSQL). But at least offering the option in a convenient way is definitely something we can do.
Moved to "Before GA" in the sense that we should make a decision on this before GA, because changing our default (transactions or not) would be breaking for users.
If we decide after GA that we want migrations to be wrapped in transactions, and mssql is anything like postgres and users started using transactions themselves inside migration scripts, their existing migrations will break.
And the reverse is also bad, because operations that would have been rolled back before wouldn't be rolled back anymore.
Factors to take into account:
Entity Framework does it, so existing SQL Server users could be expecting it.
Note from an internal discussion: Automatic rollback of a migration via transaction rollback on failure, might have implications on the migrations table. By default we would still log the migration as failed, which could/would lead to reset messaging on future Migrate commands.
Activity
tomhoule commentedon Jun 17, 2021
Maybe we don't want to do this by default because it doesn't scale to very big migrations (presumably, not very familiar with MSSQL). But at least offering the option in a convenient way is definitely something we can do.
tomhoule commentedon Jul 1, 2021
Moved to "Before GA" in the sense that we should make a decision on this before GA, because changing our default (transactions or not) would be breaking for users.
Factors to take into account:
janpio commentedon Jul 5, 2021
Note from an internal discussion: Automatic rollback of a migration via transaction rollback on failure, might have implications on the migrations table. By default we would still log the migration as failed, which could/would lead to reset messaging on future Migrate commands.