update database call a specific migration

asp.net-core entity-framework-core

Question

I try to update my database after migration (V2 is the name of the migration) :

dnx ef database update V2 -c DataContext -p Infrastructure

I have an error because dnx try to execute all migrations et not just V2.

Applying migration '20151127095324_V1'
...
There is already an object named 'myEntity' in the database

Have u an idea why it try to apply V1 migration ?

Thanks,

1
2
11/27/2015 11:00:54 AM

Accepted Answer

Below should work

dnx ef database update -c DataContext -p Infrastructure

If not, please check if "migration history" table has an entry for migration "v1"

1
11/27/2015 1:48:56 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