您如何版本化数据库架构? [英] How do you version your database schema?
问题描述
您如何准备SQL增量?您是将每个更改架构的SQL手动保存到一个增量文件夹中,还是有某种自动的差异化过程?
How do you prepare your SQL deltas? do you manually save each schema-changing SQL to a delta folder, or do you have some kind of an automated diffing process?
我对版本控制数据库模式以及源代码的约定感兴趣.也许是一个预先提交的钩子,它会与架构有所区别?
I am interested in conventions for versioning database schema along with the source code. Perhaps a pre-commit hook that diffs the schema?
此外,除了 DbDeploy 之外,还有哪些用于差异增量的选项?
Also, what options for diffing deltas exist aside from DbDeploy?
编辑:看到答案,我想澄清一下,我熟悉使用增量运行数据库迁移的标准方案.我的问题是关于自己创建增量,最好是自动创建.
seeing the answers I would like to clarify that I am familiar with the standard scheme for running a database migration using deltas. My question is about creating the deltas themselves, preferably automatically.
此外,版本控制也适用于PHP和MySQL. (请没有Ruby解决方案.)
Also, the versioning is for PHP and MySQL if it makes a difference. (No Ruby solutions please).
推荐答案
请参见
和杰夫的文章
我感到您很痛苦,希望有一个更好的答案.这可能更接近您要寻找的东西.
I feel your pain, and I wish there were a better answer. This might be closer to what you were looking for.
通常,我觉得对此没有足够的,可以接受的解决方案,因此我会在这方面提出自己的建议.
Generally, I feel there is no adequate, accepted solution to this, and I roll my own in this area.
这篇关于您如何版本化数据库架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!