Click here to Skip to main content
16,016,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I add a new migration to my solution , and when trying to update database using this command (Update-Database) , there is an error message shown 'There is already an object named 'Currency' in the database. ', i'm using entity framework core 2.0

What I have tried:

Add-Migration NewMigration
Update-Database
Posted
Updated 14-Jan-18 5:25am

1 solution

Read the error message. There's already some table, probably, called Currency in your database. You can't have two tables, or any other object for that matter, with the same name.

Also, Currency might be a reserved word in the database engine you're using. You'll have to call your table, or whatever other object it is, something else.
 
Share this answer
 
Comments
Ahmed Dabas 15-Jan-18 3:45am    
When i delete the database , then re excute command Update-Database
the update done !!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900