简体   繁体   English

与多个开发人员和数据库合作的最佳方法

[英]Best approach to working with multiple developers and databases

I've been working on a project for a couple of months now with a few other developers and it has got to the point where we all have different changes to the DB we are working with, but all of the changes are local, meaning the server is out of sync with all of our local changes. 我已经和其他一些开发人员一起进行了几个月的项目,到现在为止,我们对正在使用的数据库都有不同的更改,但是所有更改都是本地的,这意味着服务器与我们所有的本地更改不同步。

What is the best way to handle this? 处理此问题的最佳方法是什么? At the moment I tried to basically export my database from my local PC with phpMyAdmin and import that .sql file into the database on the server but as some of the tables already exist on the server it just gives out an error... 目前,我试图使用phpMyAdmin从本地PC上基本导出数据库并将该.sql文件导入服务器上的数据库中,但是由于某些表已存在于服务器上,因此它只会发出错误...

Would I have broken my database on the server by trying to import that sql file? 我会通过尝试导入该sql文件来破坏服务器上的数据库吗?

What do I do? 我该怎么办?

Ok so here's what I would do in your position... 好的,这就是我在您的职位上所要做的...

Use this tool: http://www.clevercomponents.com/downloads/dbc/dbcdownload.asp 使用此工具: http : //www.clevercomponents.com/downloads/dbc/dbcdownload.asp

With the database compare tool, it should identify the differences in structure between two databases. 使用数据库比较工具,它应该确定两个数据库之间的结构差异。 This generates an SQL file which will alter the target (your server) database to match the master (your local). 这将生成一个SQL文件,该文件将更改目标(您的服务器)数据库以匹配主数据库(您的本地数据库)。

Always backup your target database before attempting something like this, just in case it goes wrong. 尝试进行类似操作之前,请始终备份目标数据库,以防万一它出错了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM