[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Request help for subversion

From: Russ <rsivak_at_istandfor.com>
Date: 2006-09-29 15:25:22 CEST


I'm not sure if a similar tool exists for mysql, but we've been pretty happy with red-gate's tools for sql server. They have sql days compare which allows you to sync data changes and sql compare which allows you to sync schema changes. Its not version control per se, but it gives you greater control then using nothing.

Worst comes to worst, you can always switch to sql server express, which is free, and has liberal limitations.

Sent wirelessly via BlackBerry from T-Mobile.

-----Original Message-----
From: "Jun Yin" <hansyin@gmail.com>
Date: Fri, 29 Sep 2006 01:32:10
Subject: Request help for subversion


That's my first time to send mail to this address for asking help. Sorry for my poor english firstly.

I'm trying to use subversion to to version control of a mysql database.
My case is like this:
 Many guys are using a mysql database, each guy has a database copy in his own PC, they need to do some changes in their local database from time to time. then all guys need submit the changes to the central database for sharing.
I cannot find a good tool to do version control for a database(if you know one, pls tell me), so I'm thinking if I can use mysqldump to dump local database to a txt file, then using subversion to do version control of the txt file. After changing local database, each guy can run mysqldump to dump his local database to a txt file, then commit it to a central dump file repository, also they need update local dump file from central dump file repository to get somebody else's changes. then they can restore local database by updated dump file.

Maybe you will ask me why don't let all guys to share a central database, the reason is it seems like very hard to do security control, because all guys need change same table in same database(only different records), our current application does not have any security control for the database. on the other hand, to do version control of database, we can record all guy's change in an easy way, and we can arrange a manager to review changing patch, it seems like a better way.

My problem is:
1. when two guys add records at the same time, the added record will be the last line of the dump file(same place of two local dump files in two guys local PC), then subversion will think they're ***conflict***.   I cannot find a way to handle this problem, I'm thinking if subversion has a switch to do special control for the end of a file: if two guys add something in the end of a file, just merge it, don't claim conflict.
2. Can I merge a change by diff file? currently, each guy just commit changes by run "svn commit" command, this behaviour skiped the review step. In future, I hope each guy only submit the diff file(patch) to the manager, then manager can review it, if approved, then manager can merge the patch to the repository. I readed the "svn merge" command help but cannot find an answer.
3. the problem I mentioned before, Is there a good tool or another good way to do version control of a database? the way by mysqldump seems like a very stupid idea, and I also suspect it maybe will lost data in some special cases.

Thanks in advance!

Hans Yin
Web: homeofhans.homeip.net: <http://homeofhans.homeip.net> 
hansyin@gmail.com: <mailto:hansyin@gmail.com>  
MSN: hansyin@hotmail.com: <mailto:hansyin@hotmail.com> 
Skype: hans_yin_vancouver 
Received on Fri Sep 29 15:26:14 2006

This is an archived mail posted to the Subversion Users mailing list.