Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collaborating on websites with relational databases and a CMS

What processes do you put in place when collaborating in a small team on websites with databases?

We have no problems working on site files as they are under revision control, so any number of our developers can work from any location on this aspect of a website.

But, when database changes need to be made (either directly as part of the development or implicitly by making content changes in a CMS), obviously it is difficult for the different developers to then merge these database changes.

Our approaches thus far have been limited to the following:

  • Putting a content freeze on the production website and having all developers work on the same copy of the production database
  • Delegating tasks that will involve database changes to one developer and then asking other developers to import a copy of that database once changes have been made; in the meantime other developers work only on site files under revision control
  • Allowing developers to make changes to their own copy of the database for the sake of their own development, but then manually making these changes on all other copies of the database (e.g. providing other developers with an SQL import script pertaining to the database changes they have made)

I'd be interested to know if you have any better suggestions.

We work mainly with MySQL databases and at present do not keep track of revisions to these databases. The problems discussed above pertain mainly to Drupal and Wordpress sites where a good deal of the 'development' is carried out in conjunction with changes made to the database in the CMS.

like image 221
dianovich Avatar asked Feb 26 '11 15:02

dianovich


1 Answers

You put all your database changes in SQL scripts. Put some kind of sequence number into the filename of each script so you know the order they must be run in. Then check in those scripts into your source control system. Now you have reproducible steps that you can apply to test and production databases.

like image 93
ObiWanKenobi Avatar answered Sep 20 '22 23:09

ObiWanKenobi