使用DVCS [Mercurial]在版本控制下获取我的数据库 [英] Get my database under Version Control using a DVCS [Mercurial]

查看:94
本文介绍了使用DVCS [Mercurial]在版本控制下获取我的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于整个数据库的版本控制,最好的方法是什么?

What would be the best approach for versioning my whole database ?

为每个数据库对象创建一个文件(表,视图,过程...)文件,所有的DDL脚本和任何新的更改将被放在一个单独的文件?

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 ?

我想为任何类型的RDBMS提供通用解决方案。

I'd like to have a generic solutions for any kind of RDBMS.

推荐答案

我是一个巨大的VCS风扇和一个大的Mercurial助推器,但我真的认为你会下降错误的路径。

I'm a huge VCS fan in general and a big Mercurial booster, but I really think you're going down the wrong path.

VCS不只是关于迭代的变化,什么,他们也是关于回答谁为什么。对于数据库,这些答案是很少有趣或难以提供给VCS。如果你每晚出口并提交who永远是cron,为什么将永远是午夜。

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

VCS真的很好地帮助您合并来自多个分支的更改。这在数据库世界中不太适用。很少你说我想要这个表结构,但这个数据,如果你做文本/ diff合并不会帮助你太多。

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.

在工作中,我们使用Tivoli和在家里我使用rdiff备份和副本,但有很多伟大的选择。

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.

这篇关于使用DVCS [Mercurial]在版本控制下获取我的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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