Reset Entity-Framework Migrations

You need to :

  1. Delete the state: Delete the migrations folder in your project; And
  2. Delete the __MigrationHistory table in your database (may be under system tables); Then
  3. Run the following command in the Package Manager Console:

    Enable-Migrations -EnableAutomaticMigrations -Force
    

    Use with or without -EnableAutomaticMigrations

  4. And finally, you can run:

    Add-Migration Initial
    

Leave a Comment