Updating database schema with Entity Framework Code First

Entity Framework Code First is a great framework for developing new projects. But what about extending an existing database?

For instance what if I simply want to add an additional property to an existing data entity? Is there any "code first" way to do this or will I have to add a database column by hand using SQL Server Management Studio or a similar tool?

All I have found so far is how to regenerate the entire database from scratch when the schema changes, but I don't want to lose my data.

If I'm not mistaken, there is a tool for Ruby on Rails that can generate an SQL script reflecting the new database changes. Is there any way to do this in EF Code First as well?

11
задан Mathieu 2 August 2012 в 16:31
поделиться