Skip to content

Removing unapplied migrations manually #3724

Closed

Description

@AndiRudi

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.

Activity

  1. changed the title [-]Removed older migration (in the middle)[/-] [+]Removing unapplied migrations manually[/+] on Feb 11, 2022
  2. added this to the Backlog milestone on Feb 11, 2022
  3. added a commit that references this issue on Aug 11, 2026
    bb42937
  4. modified the milestones: Backlog, 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