Reputation: 147
I'm using Entity Framework 6 Code-First and my application is in production. I have to perform some changes in my models without lose any data.
I have to perform changes like these:
I need something like the Seed Database, but I need to load the data before change the model to later insert it again... I need to move the data. When I change the relationship I don't lose the data but the relation do.
How can I do this process?
Thanks so much for any help.
Upvotes: 0
Views: 2625
Reputation: 5689
I would suggest you follow these steps:
CREATE TABLE
sql Update-Database
, run a script to move data from the tables in question to your temp tablesUpdate-Database
Upvotes: 2