I used the database's tables to build an EDMX model. I want to make some changes to my model right now, and then I want to update the database.
I've read that in order to do this, I must run the enable-migrations command in the nuget terminal. I encounter the following error when I run the command.
Creating a DbModelBuilder or writing the EDMX from a DbContext created using Database First or Model First is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel.
What I want to do is make changes to the model while it is being developed, have it automatically sync with the database, and then run some SQL scripts once the migration from the model to the database has taken place. However, I keep getting the issue that I have already showed you.
Model first and migrations are incompatible. You might create a script using the schema compare tool in some versions of Visual Studio by typing https://msdn.microsoft.com/en-us/library/hh272690(v=vs.103).aspx.
If not, you might apply Code First to an existing database as follows: http://weblogs.asp.net/scottgu/using-ef-code-first-with-an-existing-database#7579835