当所有代码更改都是由DBA完成时,是否有使用EF的Code First Migrations代替? [英] Is there an alternative to Code First Migrations with EF when all code changes are done by a DBA?

查看:84
本文介绍了当所有代码更改都是由DBA完成时,是否有使用EF的Code First Migrations代替?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读过关于代码优先迁移,但似乎这并不适合企业。



我们有一个DBA可以进行我们所有的数据库更改,我们不需要将这些更改放入Classes并由应用程序执行数据库迁移。



如果我们更改我们的课程和流畅的API,然后让我们的DBA更改数据库,那么我们如何同步到我们的EF模型?通常情况下,人们使用Database First方法。

解决方案

b
$ b

当有人为您设计数据库时,手动编写实体代码,何时可以通过多次点击生成或更新模型是没有意义的。当然,如果您的团队熟悉其他主要方法的ORM,并且对Entity Framework尚不熟悉,或者如果您的团队非常小,并且没有人可以编写SQL脚本,那么Code First可能很方便,但如果您有熟练的DBA,为什么您可能需要Code First?


I've read about Code First Migrations but it seems that this is not really suited to the Enterprise.

We have a DBA that does all our Database changes and we don't need to have these changes put into Classes and have database migration performed by the application.

If we change our classes and our fluent API and then have our DBA make changes to the database then how can we sync to our EF model? How is this normally done for Enterprise size applications?

解决方案

Usually in such cases people use Database First approach.

Writing entities code manually when someone already designed database for you and when you can generate or update the model with several clicks just makes no sense. Of course, Code First could be convenient if your team is familiar with some other ORM where it was main approach and is not quite familiar with Entity Framework yet, or if your team is extremely small and nobody can write SQL script, but if you have skilled DBA, why you could need Code First?

这篇关于当所有代码更改都是由DBA完成时,是否有使用EF的Code First Migrations代替?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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