2

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
  • I found the same if EF7 thinks V1 hasn't been run on the database, it seems to want to run it . Perhaps it thinks this is the case. In your database check for __EFMigrationsHistory table and see if V1 is there before you run it. Commented Nov 27, 2015 at 14:11

1 Answer 1

2

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"

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.