I am building a web application using EF 4.0 and taking the “first model” approach, so I define all my entities, create a DDL and create a database structure based on the model.
Now, every time something changes in the model, I restore the DDL, and the database structure is recreated from scratch - the tables are discarded and recreated. In this process, I lost all the configuration data that was already there. This is fine at the moment, but moving forward as soon as the application goes into production, how can I update the database if I decide to change something?
To simplify, (how) can I update the database from the model and save all the data?
Thanks!
source share