0

I am trying to add and update second migration in asp.net core with a different name from Initial Migration, but during update-database the error says There is already an object named 'Values' in the database. How can I can I update the new Entity and not update the Values object.

Mike
  • 33
  • 7

2 Answers2

0

it seems there is a problem in migration process,
run add-migration command in "Package Manager Console"

Add-Migration Initial -IgnoreChanges

do some changes, and then update database from "Initial" file:

Update-Database -verbose

For more details refer this link

https://stackoverflow.com/a/43687656/495455

Ishwar Gagare
  • 723
  • 3
  • 9
  • I have added Add-Migration "InitialCreate" but I also wanna add this: Add-Migration AddUserEntity, this is not working Add-Migration AddUserEntity -IgnoreChanges it gives error. I can Add the migration in one migration but I wanna track down those migrations – Mike Jan 06 '20 at 12:18
0

Thanks for help, I finally find a solution. I had to remove all migrations and it worked perfectly with different name for the second migration

Mike
  • 33
  • 7