|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|
|2021-07-16 (6 months ago) ||Not yet rated by the users||Total: 104 This week: 1||All time: 9,491 This week: 185|
This package can make MySQL database schema changes generating SQL.
It can connect to a given MySQL database server using credentials read from an XML or JSON configuration files.
The package can extract the database table schema and generates a JSON file that describes the table structure.
It can also connect to another MySQL database server and generates the necessary SQL statements to perform the table schema changes to update it to be the same that is read from a JSON file previously generated from the schema of the database that is more up to date.
|Database schema changes are necessary to perform when an application needs to evolve and store more information in its database tables.
Changing a database schema is a delicate operation. The changes to be done on the database schema need to be done in the right order and use the correct SQL statements so that multiple changes can be done successfully.
This package provides a safer solution by generating a JSON file with the current database table schema definition.
Then the developer can make the database schema changes he wants in the JSON file so that the package can perform the necessary changes executing the correct SQL statements in the correct order.
MySQL schema, a simple MySQL schema synchronization utility. This will create an UPDATE/ADD query automatically based on the schema difference in the database and schema file.
Why we use MySQL Scheman
Developers find it very hard to synchronize MySQL schema while developing any application. The current conventional method is to create an SQL file with all the changes & update it in the staging/production server. The main demerit of this method is if there are multiple people and multiple SQL changes on the same table the process is a bit hectic. In order to solve this, we developed a platform where you can update the schema in a file, and by running sync to database it will create the SQL Query for the changes and it will execute.
If you use Composer, you can install MySQL Scheman with the following command:
Or alternatively, include a dependency for MySQL Scheman in your composer.json file. For example
A database configuration file should be there to communicate with the database. Please see the sample files and create a copy in your working directory with your database credentials.
### Usage (CLI)
To CLI Help
Exporting Database to Schema File:
./vendor/bin/scheman --config config.json --export yourdatabase.json
Sync the file schema with your database
./vendor/bin/scheman --config config.json --sync yourdatabase.json
See the `LICENSE` file.
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.