I'm using Red Gate SQL Compare to upgrade my database without losing data. I also use ASP.NET MVC with Entity Framework and SQL Server.
Problem is that Visual Studio still detects model modification although I've already updated the database with Red Gate SQL Compare. When I try to run add-migration
in Visual Studio and then update-database
, it crashes saying that the fields already exists.
Thanks for any help.
You may delete generated migration that is crashing, then run Add-Migration command once again, but with -IgnoreChanges flag. It will generate empty migration that will effectively do nothing except adding new entry into migration table with current model info. This should help you go on with your explicit db update.