I started off my project by using Entity Framework Code First. When I was ready I uploaded my database and code to my host provider. Everything worked.
I need to add a new field to one of my classes and I don't want to loose the data in the database. Thus, I tried following some blog posts about using Code First Migrations. I did the following:
- I backed up my remote (production) database.
- I attached this database locally
- I added the property to my class
- PM> Enable-Migrations
- PM> Add-Migration AddSortOrderToCar
- PM> Update-Database
- At this point I created a .bak file of the local database and then used that file to 'restore' to the remote one.
- Lastly, I published the code to the remote site.
When I visit the site I get the following error message: The model backing the 'blahblah' context has changed since the database was created. Consider using Code First Migrations to update the database.
What am I doing wrong?