I am using .NET Core to build an application and I am having issues with entity framework. After creating a second migration to update changes made to my models using the "dnx ef migrations add" and the "dnx ef database update" commands, I get errors regarding the attempt to drop foreign key constraints that do not exist. It looks like entity framework is not reviewing the target database before it generates the migrations file.
To try and confirm this I created a brand new database in my development environment and updated my appsettings.json file to target the new database. I then generated another migrations file to check if it would notice the database is blank and create a migrations file to build the schema. It instead created a migrations file with the same issues of trying to drop constraints that do not exist.
Shouldn't entity framework always review the database so it can find the difference between the database schema and model classes?
Thanks
dnxcommands doesn't exit any more ! It was in beta of .net core. Migrate your project to the latest dotnet core version (1.1) and usedotnetcommandsTo add a migration use command:
dotnet ef migration addTo update:
dotnet ef update