NullReference
NullReference

Reputation: 4484

How to manage Entity Framework model first schema updates?

I'm using Entity Framework 5 model first. Say I've deployed the application and I'd like to upgrade an EF entity with new columns, basically adding columns to the table.

What is the best way to upgrade the existing database without losing data? For example I have a User table that I add two new columns to. If I try to script a schema change the tables will need to be dropped in order to add the new columns. Is there a way to update the tables without needing to recreate them? Thanks!

Upvotes: 1

Views: 313

Answers (1)

Rojan Gh.
Rojan Gh.

Reputation: 1540

This may be a late answer but I have had the same problem and could just find one solution, there is an application that can update the model-first generated databases without losing the data. It can directly open the model file and update the database tables. It also installs some extensions on Visual Studio that I have not personally used but may be usable. The name is Entity Developer and there are some editions of the application listed here: Entity Developer Editions The free edition is usable only for 10 entities or less that may not suit your needs but the Professional edition is usable for 30 day as a trial that may help you do the job. The only solution I could find on the net was this one. Hope it helps you with the problem.

Upvotes: 1

Related Questions