I have 3 development environments – dev, staging and production. (PHP/MYSQL)
I am looking for a tool to synchonise my database structure across each development
environment.
I have a master_db_structure.sql file that contains the current database structure file.
So what I need to happen is:
IF
I add a new table or update a table structure in dev (and then export entire db structure to master_db_structure.sql)
THEN
Staging automatically applies a ‘CREATE TABLE’ or ‘ALTER TABLE’ because it looks at its current structure & compares it to the master_db_structure.sql file
In the past I’ve use mysqldiff tool to create a database ‘patch’ file but isnt there a better way to do this?
Hoping one of you boffins can help.
You’re looking for a migrations tool, it seems. I use Doctrine’s, but that’s part of a larger library. This looks like it could be what you want.