EntityFramework.Docs
EntityFramework.Docs copied to clipboard
Migration order matters
The documentation fails to mention that the migration order matters.
Each migration will store the snapshot which is then used by the dotnet-ef
when a migration needs to be removed.
This can easily cause a situation where the last migration (both applied and file name order) will not be the more up to date snapshot. And the following process will end up using the wrong snapshot for generating migrations:
- add migration <- creates new migration (works with no changes as well)
- remove migration <- reverts said migrations and model snapshot
- add migration <- this step will use the wrong snapshot and generate incorrect migrations
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 0fbabb60-978b-99b3-0376-b2af83765680
- Version Independent ID: fcfb2618-1415-4173-5210-ddf06ec9342e
- Content: Migrations in Team Environments - EF Core
- Content Source: entity-framework/core/managing-schemas/migrations/teams.md
- Product: entity-framework
- Technology: entity-framework-core
- GitHub Login: @bricelam
- Microsoft Alias: avickers
Note from triage: it would be good to better document this.