jezzis/mysqlsyncer

This package provides a easy way to synchronize database structure to laravel

0.1.0 2016-12-03 08:49 UTC

This package is not auto-updated.

Last update: 2024-04-27 23:55:24 UTC


README

Build Status Coverage Status Latest Stable Version License Total Downloads

This tool provide an easy way to synchronize database structure including tables, views, functions, procedures for Laravel 5.

Installation

  1. In order to install mysql-syncer, just add
  "jezzis/mysqlsyncer":"dev-master"

to your composer.json. Then run composer install or composer update.

  1. 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.