Version control software has svn git and so on, these tools control the source version is very useful, but the database version control it? The traditional approach is to export the entire database, so that team collaboration is very inefficient. Is there a tool that can easily synchronize the database structure? Some, also many, I use DBV, can integrate into Php+mysql project, very convenient.
dbv1.1 version Download Https://github.com/victorstanciu/dbv/archive/1.1.zip
How to use:
1. After downloading, extract to already in Git or SVN version of the software under the control of the project directory, such as my project directory is 93zp_project, decompression, DBV in 93zp_project/dbv-master, dbv-master/ Data is set to writable permissions.
2. Modify the Config.conf.sample to config.conf the following red places
Define (' Db_host ', 'localhost');
Define (' Db_port ', 3306);
Define (' Db_username ', 'root');
Define (' Db_password ', '123456');
Define (' db_name ', '93zp');
Where 93ZP is the database you want to version control.
3. Access http://localhost/93zp_project/dbv-master/index.php Enter the user name dBV password dBV, you can config.conf modify this user name password. You can see the 93ZP database table, each time you modify the record can see the following page:
The column "in DB" indicates whether the record is in the database, and the column "on disk" indicates whether the record was exported to the hard disk. You see that the value of on disk is no to indicate that the modification record has not been exported.
4. Press the button "Export to disk" and export the record so that the record can be saved under Dbv-master/data/schema.
When a team member updates a project, it also accesses http://localhost/93zp_project/dbv-master/index.php to see which records need to be imported into the database, tick the corresponding record, press the button [push to Databse] You can synchronize the database! After synchronization, in DB is the Yes state, for example, the modified record AAA and SSSS have been synchronized.
MySQL database version control DBV use