EntityFramework.Docs icon indicating copy to clipboard operation
EntityFramework.Docs copied to clipboard

Migration order matters

Open tibold opened this issue 3 years ago • 1 comments

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.

tibold avatar Sep 23 '21 09:09 tibold

Note from triage: it would be good to better document this.

ajcvickers avatar Sep 28 '21 11:09 ajcvickers