asp.net 的 Rails 风格数据库迁移?

发布于 2024-08-17 17:00:38 字数 253 浏览 1 评论 0原文

我喜欢更新数据库模式的 Rails 风格。我可以将迁移定义为一个具有相当简单但功能强大的语法的类。我可以使用单个命令运行更新,并且我的所有模型都会更新。它们致力于源代码控制,并且可以轻松读取、修改和撤消。

我当前为我的 asp.net mvc 项目执行此操作的方法是打开服务器资源管理器,手动更改数据库字段,然后重新生成所有 linq-to-sql 类。这种方法很麻烦,容易出错,并且几乎缺乏上面列出的所有优点。我相当确定必须有更好的方法。

有人可以启发我吗?

I am in love with the rails style of updating db schema. I can define a migration as a class with fairly simple, yet powerful syntax. I can run the updates with a single command and all of my models are updated. They are committed to source control and can be easily read, modified, and undone.

My current way of doing it for my asp.net mvc project is to open up the server explorer, manually change the database fields, then regenerate all of my linq-to-sql classes. This method is cumbersome, error prone, and lacks almost all of the advantages listed above. I am fairly sure there has to be a better way.

Can anybody enlighten me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

油焖大侠 2024-08-24 17:00:38

Rob Conery 的 Subsonic 在 .NET 中具有类似迁移的功能:

http:// blog.wekeroad.com/2007/10/03/subsonic-migrate-me/

还有很多其他工具包提供类似的方法:

我相信还有更多。

Rob Conery's Subsonic has something like migrations in .NET:

http://blog.wekeroad.com/2007/10/03/subsonic-migrate-me/

There are plenty of other toolkits offering similar approaches:

I'm sure there are more out there.

浊酒尽余欢 2024-08-24 17:00:38

老问题,但仍然有效,所以这里有一个可能对某人有帮助的附加答案。

这个问题/答案在这里有一个候选者列表,不要忘记也可以查看 Fluent Migrator

Old question, but still valid, so here's an additional answer that might be helpful to someone.

This question/answer here on SO has a list of candidates, and don't forget to check out Fluent Migrator as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文