Handling Database Migration Using Entity Framework

We create a C # application that uses the Entity Framework with SQL Server 2008. We develop the model using the constructor in Visual Studio and automatically generate objects from this.

We are working on version 1.0. When we release 2.0, we need to make changes to the model and basic structure of the database. I think we need what is called database migration.

Traditionally, I had a table in the database called the "version". Whenever I created a new version of my software, I created database update scripts containing ALTER TABLE statements. My software checked the version table and ran the upgrade scripts needed to upgrade the database to a โ€œsoftware versionโ€.

Is there a better way to handle this? It would be nice if I did not have to write alter table-scripts and write my own software to update the database structure.

+5
source share
2 answers

, , , , ( myapp, , EF4 myapp_schema). myapp_schema , Db Source Tools, myapp , myapp_schema.

0

All Articles