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

Request help for subversion

From: Jun Yin <hansyin_at_gmail.com>
Date: 2006-09-29 10:32:10 CEST

Hi,

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!

-- 
Rgds,
Hans Yin
Web: homeofhans.homeip.net
Email: hansyin@gmail.com
MSN: hansyin@hotmail.com
Skype: hans_yin_vancouver
Received on Fri Sep 29 10:32:45 2006

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