MySQL版本控制-Subversion [英] MySQL Version Control - Subversion

查看:54
本文介绍了MySQL版本控制-Subversion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道是否可以对MySQL数据库进行版本控制.

Wondering if it is possible to have a version control of a MySQL database.

我知道这个问题以前曾被问过,但是最新的问题大约是一年前的,而且事情以变化的速度...

I realize this question has been asked before however the newest is almost a year ago, and at the rate things change...

问题来了,每个开发人员在自己的计算机上都具有apache/MySQL/PHP,有时他们会在该计算机上编辑数据库.如果他们必须向所有其他开发人员发送电子邮件,然后手动编辑测试服务器数据库,则相当不便.

The problem is coming that each developer has apache/MySQL/PHP on their own computers to which they sometimes edit the database. Its rather inconvenient if they have to send an email to all the other developers and then manually edit the test servers database.

您如何处理此问题?

谢谢

推荐答案

这本身不是与MySQL相关的解决方案,但是我们使用liquibase产品取得了很多成功. ( http://www.liquibase.org/)

This is not a MySQL-related solution in itself, but we've had a lot of success with a product called liquibase. (http://www.liquibase.org/)

这是一个迁移解决方案,涵盖了许多不同的数据库供应商,允许所有数据库更改都编码在配置文件中,所有这些更改都保存在Subversion中.由于所有配置都保存在XML文件中,因此很容易将其他人的更改合并到主线脚本中,并且可以很好地与标签和分支一起使用.

It's a migration solution which covers many different database vendors, allowing all database changes to be coded in configuration files, all of which are kept in Subversion. Since all configuration is kept in XML files, it's easy to merge other people's changes into the mainline script and it plays well with tags and branches.

可以通过运行更新数据库"命令将数据库升级到当前修订版本级别.大多数更改还具有回滚数据库更改的功能,这也可能会有所帮助.我建议您遵循一定的做法,确保在运行迁移之前获得最新信息,因为这可能是最简单的.

The database can be brought up to the current revision level by running the "update database" command. Most changes also have the ability to roll-back a database change, which can be helpful too. I would recommend following the practice of making sure you get current before running the migration, as this would likely be easiest.

最后,当涉及到生产交付时,您可以选择将所有数据库更改输出作为完整的SQL脚本输出,以便它可以允许DBA运行它并保持职责分离.

Finally, when it comes to a production delivery, you can choose to have all the database changes output as a full SQL script so it can allow DBAs to run it and maintain a separation of duties.

到目前为止,它的运作就像是一种魅力.

So far, it's worked like a charm.

这篇关于MySQL版本控制-Subversion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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