Skip to content

Migration order matters #3444

Closed
Closed

Description

@tibold

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.

Activity

  1. changed the title [-]Migration order matter[/-] [+]Migration order matters[/+] on Sep 23, 2021
  2. ajcvickers commented on Sep 28, 2021

    @ajcvickers
    Contributor

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

  3. added this to the 6.0.0 milestone on Sep 28, 2021
  4. modified the milestones: 6.0.0, 7.0.0 on Nov 3, 2021
  5. removed their assignment
    on Jul 8, 2023
  6. added a commit that references this issue on Aug 11, 2026
    bb42937
  7. modified the milestones: 7.0.0, 11.0.0 on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions