On Sep 29, 2006, at 03:32, Jun Yin wrote:
> 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.
The problem is that a mysqldump does not convey information about how  
changes were made. For example, if you alter a table to add a new  
column, and you populate the new field with values, how did you do  
this? Did you manually input values in your INSERT statement, or did  
you use INSERT ... SELECT to get the values from other fields?  
mysqldump won't tell you. What (IMHO) you really need is a way to  
preserve the original SQL statements and send these up to the main  
database. And the only way I know of to do this is to have each  
developer write down (e.g. copy and paste into a file) the statements  
they want preserved. I don't think a tool can determine this for you,  
much in the same way that Subversion cannot determine for you whether  
you renamed a file or moved it or copied it or whatever, as explained  
in this FAQ entry:
http://subversion.tigris.org/faq.html#wc-change-detection
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Oct  2 04:49:05 2006