MySQL Version Control - Subversion(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.
你是如何处理这个问题的?
How do you deal with this problem?
谢谢
推荐答案
这本身并不是一个与 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:MySQL 版本控制 - Subversion
基础教程推荐
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 无法解决整理冲突 2021-01-01
