Question

I want to see all available of migrations in a project. Command Get-Migrations returns all applied migrations to DB, but I want to see all migration list, including not applied. Reason : I have created one more migration in the project and want to remove it. I removed files of migration, but Visual Studio (solution) remember of this migration and want to apply it.

enter image description here

Where is 201706071156593_AutomaticMigration at all and how to remove it?

1
1
6/7/2017 12:00:20 PM

Popular Answer

Deleting the files should be sufficient - have you built the project since?

You can programmatically access the list of migrations using the DbMigrator class, which has a method GetPendingMigrations() which will return the name of all migrations which it is aware of that have not yet been applied.

Update: Now that you've updated your question with the migration name, it becomes clear that because you have Automatic Migrations enabled (in the constructor of Configuration), this is the cause. To use explicit migrations only, change AutomaticMigrationsEnabled to false.

1
6/8/2017 7:21:43 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow