views:

1250

answers:

4

Hi!

What tools are you using to track changes in your MySQL database?
Currently I'm in a project where we use a plain text-file (version controlled via SVN) in which we manually add SQL statements when making changes to the database.
Many of the changes magically disappears every now and then, and we are now looking for a better way to change track our database.

EDIT:
One thing that I forgot to mention, we are using stored procedures and functions, so it's not only the database structure that we want to track changes on / version controll.

+4  A: 

There is a simple solution:

  • Make all changes to the database schema and static data via scripts
  • Version control the scripts
anon
Hi! Thanks for your answer, however, I dont see how this is different from what we are currently doing? please explain more, I might just be missing the point.
fredrik
Is the plain text file actually run against the database (.e. is is used as a script)? From your question, I got the impression it was just a record of changes.
anon
When I make a change to the DB, I add the alter table sql (or create prcedure or what ever it might be) statement to this plain-text file, and then my colleagues will run these statements against their local databases, but sometimes it is forgotten.. and sometimes it's forgotten to be added to the version-controlled file.But I'm starting to get what you mean I think, adding the changes to the scriptfile, and the run it against my own local database?
fredrik
anon
I ended up making a solution based in you idea. I made a folder structure representing the database, e.g Database/DatabaseName/Procedures/ProcedureName.sql and Database/DatabaseName/Tables/TabelName.sql, then I made a PHP script that will run all the .sql scripts in the right place in the database.. so far it seems like it will work :) Thanks.
fredrik
A: 

I think you need something like this (I test it for Firebird and it works very well) : http://www.upscene.com/products.audit.index.php I thought there was a MySQL version but NO :(

for MySQL, I see just this : http://solutions.mysql.com/solutions/partner.php?partner=1532

But if it is just for development, I think that the answer given here is good

Hugues Van Landeghem
+1  A: 

I just ask a very similar question recently: http://stackoverflow.com/questions/755704/starting-with-versioning-mysql-schemata-without-overkill-good-solutions

tharkun
A: 

mysql-diff compares tables, but not stored procedures yet.

stepancheg