phpsqldiff – Compare mysql schemas with PHP

You know the problem:
There are two mysqldumps and you’d like to create update queries based on them. This is not an easy task and I have not found a solution which provided what I wanted. So I went and did something by myself.

The result is phpsqldiff.
A PHP class to compare mysqldumps and create update queries.

It’s a simple php class which compares two files with mysqldumps and creates update queries from it. It is currently taking care of the following situations:

  • Adding, dropping and renaming of tables
  • Adding, dropping, changing and renaming of columns
  • Adding and dropping of indexes

There are lots of possible pitfalls when comparing mysqldumps. Therefore use it carefully and wisely.

Find the code on Github.