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,

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"




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why