开发者

Entitiy Framework: "Update Database from Model" instead of "Generate Database from Model"

开发者 https://www.devze.com 2023-01-03 12:00 出处:网络
I have created a Entity Framework 4 model with Visual Studio 2010 and generated a database from it. Now I found myself adding new properties (with default values), changing documentation of columns, c

I have created a Entity Framework 4 model with Visual Studio 2010 and generated a database from it. Now I found myself adding new properties (with default values), changing documentation of columns, changing names of columns, changing types of columns several times. All tasks that do not require much "extra work" in order not to be possible to be achieved automatically (in my humble opinion). Everytime I did "Generate Database from Model" and lost of course the table data.

Is there a way just to update the database's architecture so to say - leaving the table data untouched? Maybe with some user interaction especially when changing types etc.? Or would this functionali开发者_运维技巧ty be simply too difficult to be realized to work in a reliable way?

Thanks in advance! Cheers, David


Noam Ben-Ami - MSFT1 (Microsoft Employee) answered my question at http://social.msdn.microsoft.com/Forums/en-us/adodotnetentityframework/thread/3adc080f-ee8c-4104-be29-95b2fb3fabe9 as follows:

We've build the entity designer database power pack to support this. You can download it here: http://visualstudiogallery.msdn.microsoft.com/en-us/df3541c3-d833-4b65-b942-989e7ec74c87

It includes a database generation workflow for the designer that does migration, rather than drop/create.

This posting is provided "AS IS" with no warranties, and confers no rights.

I haven't tested the tool yet, but I guess the info might be valueable for others, too.

0

精彩评论

暂无评论...
验证码 换一张
取 消