实体框架4.0 - 生成更改脚本 [英] Entity Framework 4.0 - Generate change script
问题描述
我建立我的应用程序中使用的EF 4.0(MS SQL 2008)和模型越来越大。
I have build my application using EF 4.0 (MS SQL 2008) and the model is getting bigger.
我的问题是,当我添加新表/约束等的模型,我会uptil现在生成一个脚本来创建我的SQL数据库,但它丢弃所有的表,所以我失去所有的数据。 : - (
My problem is when I add new tables / constraints etc. to the model, I'll uptil now generate a script to create my SQL database, But it drops all tables, so I loose all data. :-(
有谁知道如何只生成更改脚本,这样我就可以保持数据,只是更新数据库?
Does anyone know how to just generate a change script, so I can keep data and just update the database?
在此先感谢。
瑟伦
推荐答案
如果您有现有的和新手头的数据库实例,你可以尝试的展鹏的SQL比较打造的更改脚本。我可以推荐这个,因为我目前正在测试它构建到我们的变更管理部署过程中(还没有自己的产品,但评估)
If you have an instance of both the existing and new databases on-hand, you can try Redgate SQL Compare to build the change script. I can recommend this because I am currently testing it to build it into our change management deployment process (do not yet own the product, but evaluating)
编辑 - 我本来把SQL源的控制,但实际上意味着SQL进行比较。固定的。的
这篇关于实体框架4.0 - 生成更改脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!