jezzis / mysqlsyncer
This package provides a easy way to synchronize database structure to laravel
Requires
- php: >=5.6.0
- illuminate/config: ~5.2
- illuminate/console: ~5.2
- illuminate/database: ~5.2
- illuminate/support: ~5.2
Requires (Dev)
- cogpowered/finediff: ^0.3.1
- mockery/mockery: dev-master
- phpunit/phpunit: ~4.1
- sami/sami: dev-master
- satooshi/php-coveralls: dev-master
This package is not auto-updated.
Last update: 2024-11-10 03:03:46 UTC
README
This tool provide an easy way to synchronize database structure including tables, views, functions, procedures for Laravel 5.
Installation
- In order to install mysql-syncer, just add
"jezzis/mysqlsyncer":"dev-master"
to your composer.json. Then run composer install
or composer update
.
- In your
config/app.php
add
Jezzis\MysqlSyncer\MysqlSyncerServiceProvider::class
Configuration
If you want to customize the base path of the sql file, please copy src/config.php to laravel project config directory, rename it to msyncer.php
return [ 'sql_path' => './', // sql file base path where MySQL-Syncer is looking for. 'driver' => 'mysql', // connection driver, currently only supports MySQL. ];
Usage
run the command in console:
# php artisan db:sync --drop <file>
Params
- file: The file path of the sql file, without .sql extension
Options
- --drop: allow drop columns, keys
Troubleshooting
Grant select privilege on mysql.func and mysql.proc to make sure the tools can fetch the definition of functions & procedure.
License
mysql-syncer is free software distributed under the terms of the MIT license.
Contribution guidelines
Support follows PSR-1 and PSR-4 PHP coding standards, and semantic versioning.
Please report any issue you find in the issues page. Pull requests are welcome.