Bored by exporting & importing remote db to the local is history. With this package, just run single command and everything get processed in the background.
You can install the package via composer:
composer require indeev/laravel-remote-db-sync --dev
It is required to have external connection defined in config/database.php
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
// ...
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
// ...
],
'azure' => [ // Our external database connection
'driver' => 'mysql',
'host' => env('DB_HOST_AZURE', 'dbservicename.mysql.database.azure.com'),
'port' => env('DB_PORT_AZURE', '3306'),
'database' => env('DB_DATABASE_AZURE', ''),
'username' => env('DB_USERNAME_AZURE', ''),
'password' => env('DB_PASSWORD_AZURE', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'server_version' => '5.7',
'modes' => [
'ONLY_FULL_GROUP_BY',
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'ERROR_FOR_DIVISION_BY_ZERO',
'NO_ENGINE_SUBSTITUTION',
],
],
// ...
To sync all tables:
php db:sync_remote azure
To sync everything without tables marked for skip:
php db:sync_remote azure --skipped=cache,log
To sync only defined tables (if --only is set, --skipped is ignored):
php db:sync_remote azure --only=customer,customer_settings
In all cases above can be added parameter --only_schema=table,names to define tables without data sync. For instance to sync everything without tables cache, log and without data on tables documents, document_metas:
php db:sync_remote azure --skipped=cache,log --only_schema=documents,document_metas
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email katerinak@indeev.eu instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.