Entity Framework detects model modification although db is updated with SQL Compare

56 views Asked by At

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.

1

There are 1 answers

0
dropoutcoder On

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.