如何同步开发和生产数据库 [英] How to synchronize development and production database

查看:377
本文介绍了如何同步开发和生产数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道任何应用程序可以同步两个数据库吗?在开发过程中,有时需要添加一个或两个表行或新的表或列. 通常,我将每个sql语句写在某个文件中,并且在上载路径期间,将这些行移出生产数据库中(之前对其进行备份). 我使用mySQL和postreSQL数据库.

Do you know any applications to synchronize two databases - during development sometimes it's required to add one or two table rows or new table or column. Usually I write every sql statement in some file and during uploading path I evecute those lines on my production database (earlier backing it up). I work with mySQL and postreSQL databases.

您的做法是什么,哪些应用程序可以帮助您.

What is your practise and what applications helps you in that.

推荐答案

您要求提供工具或应用程序答案,但真正需要的是过程答案.这里的基本主题是,您应该对数据库DDL(和DML,如有需要)进行版本控制,并提供更改脚本,以便能够将数据库的任何版本更新为更高版本.

You asked for a tool or application answer, but what you really need is a a process answer. The underlying theme here is that you should be versioning your database DDL (and DML, when needed) and providing change scripts to be able to update any version of your database to a higher version.

由Jeff Atwood提供并由K.Scott Allen编写的这组链接详细说明了它的外观-它们比我在这里可能写的要好得多:

This set of links provided by Jeff Atwood and written by K. Scott Allen explain in detail what this ought to look like - and they do it better than I can possibly write up here: http://www.codinghorror.com/blog/2008/02/get-your-database-under-version-control.html

这篇关于如何同步开发和生产数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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