I\'ve been playing with Entity Framework 4, using the model driven approach to generate the database script from my entities. This is great but I\'m not sure how this works
This will be coming soon as a NuGet package called EntityFramework.Migrations
A demo was performed by Scott Hanselman at TechEd 2011 (available online at http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV349). The relevant section is 45 minutes in.
In short, once the package is installed, you'll enter the following into the Package Manager Console to generate a database change script:
migrate -script
UPDATE (13-Nov-2011)
The alpha 3 build of this package is now available on NuGet. Rather than use the cmdlet migrate -script mentioned above, it uses the cmdlet Add-Migration . A walk-through of its use can be found on the ADO.NET team blog.
UPDATE (14-Feb-2012)
This functionality is now available as part of the main EntityFramework NuGet package, starting with version 4.3. An updated walk-through using EF 4.3 can be found on the ADO.NET team blog.