Error Happened when Update Database Using EF Core
I add a new migration to my solution , and when trying to update database using this command
there is an error message shown
There is already an object named 'Currency' in the database
I'm using Entity Framework Core 2.0
As error says
Someone added already added an object
Seems there is a problem in migration process.
You can try following solution if they helps.
add-migrationcommand in "Package Manager Console":
Add-Migration First -IgnoreChanges
do some changes, and then update database from "Initial" file:
If you are working on a Team Project. I will suggest you to set
AutomaticMigrationsEnabled = false;
It will ensure unpredictable migrations and make sure that every developer on the team works with the same data base structure.
You can also try
Update-Database -Scriptfor update a database manually. And you can exclude 'Currency' from resulting script