I've mucked up my migrations, I used IgnoreChanges
on the initial migration, but now I want to delete all my migrations and start with an initial migration with all of the logic.
When I delete the migrations in the folder and try and Add-Migration
it doesn't generate a full file (it's empty - because I haven't made any changes since my last, but now deleted, migration).
Is there any Disable-Migrations command, so I can rerun Enable-Migrations
?
You need to :
__MigrationHistory
table in your database (may be under system tables); ThenRun the following command in the Package Manager Console:
Enable-Migrations -EnableAutomaticMigrations -Force
Use with or without -EnableAutomaticMigrations
And finally, you can run:
Add-Migration Initial