开发者

Database Schema Change and Entity Framework 4 in Release Production Environment

开发者 https://www.devze.com 2023-01-18 10:51 出处:网络
OK, here we go, after reading a couple of related questions, I haven\'t ended into a real productive solution for my thoughts.

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 s开发者_JAVA技巧chema 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).

0

精彩评论

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