Pathologically Eclectic Rubbish Lister | |
PerlMonks |
SQL Diffby pileofrogs (Priest) |
on Jun 01, 2009 at 16:53 UTC ( [id://767319]=perlquestion: print w/replies, xml ) | Need Help?? |
pileofrogs has asked for the wisdom of the Perl Monks concerning the following question: Greetings ye Monks. I want to put a database into version control. We have a devel and production web server with lots of stuff in a database. Small updates often go directly to the production server and larger updates go first to the devel server and later to the production server. Often the small changes only go to the production server and some testing data remains on the devel server, and the two servers generally diverge. If I could put the two databases into version control, I could merge them in a rational fashion from time to time. The problem is, how do you diff and merge a database? This is tricky because normal text diff is based on changes in lines of text, which might work on a text dump of a database if you didn't also have to worry about ID collisions. An ID collision as I'm talking about it is where someone adds some data to one datbase and that data gets an automatically assigned ID key. Unless the next available ID is always the same on both databases, different bits of data will have different IDs, which breaks everything. I think the answer would involve a diff-like utility that examines the differences between two databases and produces SQL that could make the appropriate changes to another database in a way that won't cause ID collisions. This brings me to the perl part of this question. Does anyone have any recommendations for how to go about comparing two databases like this? I assume the heavy lifting can be done by existing perl modules. Which would people recommend? Any other ideas? Thanks!
Back to
Seekers of Perl Wisdom
|
|