At work, I occasionally need to move database changes from the development server to the live server. We have about a hundred tables, which makes it difficult to review by hand. So there is a comparison script that basically runs a `mysqladmin` schema dump on both databases and then diffs the two files. The result is a little difficult to decipher at times and still requires manual scripting to make the final ALTER commands.
What if I could run a PHP script that would compare any two schemas and generate proper ALTER commands to correct the two of them. I would probably use some combination of these SQL commands:
- SHOW TABLES
- SHOW CREATE TABLE ‘tablename’
- SHOW COLUMNS FROM ‘tablename’
I’m going to have to think about this tonight. Maybe punch out a test script tomorrow.

