Database Schema Change and Entity Framework 4 in Release Production Environment

孤人 提交于 2019-12-13 18:16:05

问题


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.


回答1:


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).



来源:https://stackoverflow.com/questions/3815185/database-schema-change-and-entity-framework-4-in-release-production-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!