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
Sometimes you have a branch where you made a migration and the branch was put on hold for a while. In the meantime developers make other migrations and once you start to work on your branch again you may realise that the migration as it was made a while ago does not work anymore like this and you need to create it again.
As the migration has never been applied it should not be a problem to remove it (and fix the snapshot) and then just create it new as the newest migration.
In the docs there is only a description how to remove the newest migration, but not how to remove a migration in the middle. I guess the approach would be to delete the migration file and find everything related to it in the snapshot file (e.g. modelBuilder.Entity(...))?
I think it's worth to mention those more exotic things in the docs as well, because in a team environment this often happens.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 5d4bb699-8a1f-b908-65f8-3c3dbbea25e7
Version Independent ID: 9d82c393-ac60-0526-1779-f51c8ce16102
Activity
[-]Removed older migration (in the middle)[/-][+]Removing unapplied migrations manually[/+]Expand and clarify migrations guidance. (dotnet#5445)