EF Code First Migrations August 2011 CTP Released
EF Code First is a great ORM tool which lets you to develop applications in a Domain Driven approach. One of the pain point of EF Code First was the data migrations when your domain model is changing. Finally the ADO.NET team is providing a data migration solution for EF Code First that will incrementally evolve the database schema as you model changes over time. The ADO.NET team has released the CTP version of Code First migration solution named EF Code First Migrations August 2011 CTP. EF Code First Migrations is available as NuGet package named EntityFramework.SqlMigrations. The following command in the NuGet console will install the the EF Code First Migrations
PM> Install-Package EntityFramework.SqlMigrations
The EF Code First Migrations is providing different solutions for data migration that can be used for different requirement contexts.
You can perform the following command in the NuGet console for maintaining your data after the model change.
PM> Update-Database
The following command will rename a column name Phone of Customer entity with ContactPhone
PM> Update-Database -Renames:"Customer.Phone=>Customer.ContactPhone"
Check out the ADO.NET team blog for more details about EF Code First Migrations August 2011.