发布生产环境中的数据库模式更改和实体框架4 [英] Database Schema Change and Entity Framework 4 in Release Production Environment

查看:266
本文介绍了发布生产环境中的数据库模式更改和实体框架4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,在这里我们去,在读了几个相关的问题后,我没有结束一个真正有效的解决方案为我的想法。



想法: p>

当我们所有的开发人员创建应用程序,然后这些应用程序进入生产,客户端几天后需要额外的功能。
太棒了!你可以通过服务器资源管理器打开你的数据库,创建表,添加列,也许改变数据类型,然后从数据库更新你的模型,好的一切就OK了!



项目(InstallShield,InstallAware,VS安装程序...)。
您可以有一个模式比较工具,获得脚本,尝试它(它的工作),然后将其添加到InstallShield或另一个安装程序支持此工作!



虽然如果有一个方法为实体框架实现更改,或者如果有一个开箱即用的方式更新基于您的模型的模式?



一般是有Entity Framework 4架构更改支持?



谢谢。

解决方案

您从不打开服务器资源管理器修改您的模式,这是所有的崩溃。您总是编写升级脚本,然后将升级脚本应用于客户端站点。请参见版本控制和数据库。或者将项目存储为VS DB项目,并应用基于 vsdbcmd 的根据您的.schema文件升级现场数据,但是使用这种方法,您放弃了一个很大的控制,如果你有大表,它可以毁了你的一天。



至于建模工具模式升级支持功能:它们远远落后于VSDB升级功能,我个人认为显式升级脚本远远优于和更灵活任何基于diff的工具(EF,VSDB,SQL Compare等)。


OK, here we go, after reading a couple of related questions, I haven't ended into a real productive solution for my thoughts.

Thoughts:

As we all developers creating applications, then these apps going into production, the client after couple of days demands additional features. Great! you open your database through Server Explorer, create tables, add columns, maybe changing datatypes and then updating your model from database, nice it works everything OK!

Now you release the project with your way (InstallShield, InstallAware, VS Setup Project...). You could e.g. have a schema compare tool, get the script, try it (it's working) and then add it to "InstallShield" or another installer supports this job!

I have been searching though if there is a way for entity framework to realize the changes, or if there is an out of the box way to update the schema based on your model???

In general is there Entity Framework 4 Schema Change support?

Thank you.

解决方案

You never open Server Explorer to modify your schema, thats where it all falls apart. You always write an upgrade script and then apply the upgrade script to the client site. See Version Control and your Database. Or you store the project as a VS DB project and apply a vsdbcmd based upgrade of the on-site data based on your .schema file, but with this approach you give up a lot of control and it can ruin your day if you have large tables.

As for modeling tools schema upgrade support capabilities: they are quite well behind of the VSDB upgrade capabilities, and personally I find the explicit upgrade script based far superior and more flexible than any of the diff based tools (EF, VSDB, SQL Compare etc).

这篇关于发布生产环境中的数据库模式更改和实体框架4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆