Run Code First Migration Seed Method without a migration

ef-code-first entity-framework

Question

How do you run a code first entity framework migration without changing anything in the datamodel which would cause a migration to be created? I just want to run the seed method again because I added things to it.

1
36
2/26/2015 2:59:03 PM

Accepted Answer

If you just need to run Seed() again, and nothing has changed that would cause a new migration to be added, just call Update-Database again with no flags and it will say 'No pending migrations', and run Seed() again for you. Seed() is called every time the DB is updated, regardless if there are new migrations or not.

63
2/26/2015 5:00:47 PM


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