Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework 4 - Update database schema from model. Without wiping the table data

I'm working on a new project where I have the luxury of working from a Model to Database approach using Entity Framework 4.

The project I'm working on is taking an agile approach where different phases will be rolled out over time.

Will the Model First approach work in my case? I noticed when you "Generate Database from Model" it recreates the entire schema from scratch which will obviously wipe all the data that is in the db.

I was hoping for a more "Update Database from Model" approach where the db would just be altered to reflect the changes rather than recreated.

Does anyone have any experience working in this type of workflow with EF?

Thanks,

James Sheldon

like image 557
sheldonj Avatar asked Sep 05 '25 08:09

sheldonj


1 Answers

you can now use migrations and commit what you desire on you database.

look at this article

like image 62
Mahdi Avatar answered Sep 08 '25 01:09

Mahdi