使用 DVCS [Mercurial] 将我的数据库置于版本控制之下
对整个数据库进行版本控制的最佳方法是什么?
为每个数据库对象(表、视图、过程……)创建一个文件,或者为所有 DDL 脚本创建一个文件,并且任何新的更改都将放在一个单独的文件中?
如何处理数据库管理器工具中所做的更改?
我希望有一个适用于任何类型的 RDBMS 的通用解决方案。
还有其他选择吗?
What would be the best approach for versioning my whole database ?
Creating a file for each database object (table,view,procedsure..) or rather having one file for all DDL scripts and any new change will be put in a separate file ?
What about handling changes made in a Database manager tool ?
I'd like to have a generic solutions for any kind of RDBMS.
Are there any other options ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
评论(4)
月下客2024-09-18 18:42:24
SQL Source Control 目前支持 SVN 和 TFS,但 Mercurial 请求正在迅速增加,我们'我们希望很快就能有一个关于这个的故事。
我们使用 UserVoice 来衡量需求,因此如果您对此感兴趣,请相应投票:http ://redgate.uservoice.com/forums/39019-sql-source-control
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
总的来说,我是 VCS 的忠实粉丝,也是 Mercurial 的大力支持者,但我真的认为您走错了路。
VCS 不仅仅涉及迭代变更、“什么”,还涉及回答“谁”、“何时”和“为什么”。对于数据库来说,这些答案不太有趣或者很难提供给 VCS。如果您每晚进行导出并提交,“谁”将始终是“cron”,“为什么”将始终是“午夜”。
现代 VCS 做得很好的另一件事是帮助您合并来自多个分支的更改。这在数据库领域不太适用。你很少会说“我想要这个表结构,但是这个数据”,如果你这样做,文本/差异合并不会对你有太大帮助。
能够很好地完成“什么”和“何时”的事情是增量备份系统,这可能是更合适的选择。
在工作中我们使用 Tivoli,在家里我使用 rdiff-backup 和 duplicity,但是还有很多不错的选择。
我想我的一般经验法则是“如果它是由人手工输入的,那么它就会进入源代码管理,如果它是生成/导出的,那么它就会进入增量备份”
当然你可以完成这项工作,但我不这样做与更传统的备份解决方案相比,它不会给您带来太多好处。
I'm a huge VCS fan in general and a big Mercurial booster, but I really think you're going down the wrong path.
VCSs aren't just about iterative changes, the "what", they're also about answering the "who", "when", and "why". For a database those answers are a lot less interesting or hard to provide to the VCS. If you're doing nightly exports and commits the "who" will always be "cron" and the "why" will always be "midnight".
The other thing modern VCSs do really well is helping you merge changes from multiple branches. That's less applicable in the database world. Very seldom do you say "I want this table structure, but this data", and if you do the text/diff merge isn't going to help you much.
The thing that does do "what" and "when" very well is an incremental backup system, and that's probably the better fit.
At work we use Tivoli and at home I use rdiff-backup and duplicity, but there are plenty of great options.
I guess my general rule of thumb is "if it was typed by hand by a human then it does into source control, and if it was generated/exported then it goes in the incremental backups"
Certainly you can make this work, but I don't think it will buy you much over the more traditional backup solutions.