Right way to work with C5 database in team

Permalink 1 user found helpful
Hi, guys!
What is your workflow for developing C5 projects in team?
I mean, let's imagine, that 2 developers are working with the same website simultaneously. And at some moment they have to merge their changes with each other.

So, in case of files - it's easy, we just need to use GIT for that. But what for database? How can we merge changes in DB? What is the correct workflow for C5 project?

 
stewblack23 replied on at Permalink Reply
stewblack23
You could use Mainio Sync to merge the databases. I have not used it personality but I have heard good things about it. Only issue is the developer has yet to updated it for C5 8.2.1.

https://www.concrete5.org/marketplace/addons/mainio-sync...
Gondwana replied on at Permalink Reply
Gondwana
Here's a low-tech (and a bit manual) solution:

Back up both of the databases (eg, using CPanel/mysqldump).

Unpack each backup (if necessary) to get the .sql file.

Use a text editor or utility to compare the files. This will highlight any changed lines.

Merge the changes as you see fit.

Upload ('restore') the modified .SQL.

Presumably the most important changes will be to table structure rather than contents. You could refine this approach to help you find structural changes only.
pixelhero replied on at Permalink Reply
pixelhero
There are few ways to merge databases nicely. Its a horrendous job as there is often no way of knowing when or what anything was changed for.

You would need to set up some platform which you specify the tables that *may* change and then compare any difference and pick which is right or merge them manually.

Usually when you make database edits, you do not ever move a development database up to a staging/live site. You should write patching SQL files which contain the changes and timestamp the filenames. When you put your new git repo live, run the sql files in date order.
vonanko replied on at Permalink Reply
Thanks for suggestions guys!
Still searching for something much complex I think. Some approach that will help to merge databases in more automated way... And I think this topic is behind C5 issues scope. It's like some kind of DevOps stuff.