I'm trying to update my db with changes I've made in my entity models (a few extra table columns), but I don't want to drop & recreate the database as it will delete all my test data. Previously I've done this and used the Seed method to create some basic data, but now I have a lot of data which I'd rather keep.
I've tried to run update-database but I get the error:
There is already an object named 'ActivityNoteLines' in the database.
Looking at the migration script I can see that it's trying to create the table ActivityNoteLines. Obviously I don't want it to to that. I then created an initial migration using
Add-Migration InitialCreate –IgnoreChanges
but now when I run update-database, it thinks there are no changes!
I'm sure it's possible to do what I want, but I can't seem to get it to work. If I have to drop & recreate the db I will but would like to know if anyone has successfully updated AND kept the data.
MigrateDatabaseToLatestVersion