定制 indeev/laravel-remote-db-sync 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

indeev/laravel-remote-db-sync

最新稳定版本:v2.0

Composer 安装命令:

composer require indeev/laravel-remote-db-sync

包简介

Quickly sync remote database to local

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Laravel Remote DB Sync

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.

Installation

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',
            ],
        ],
        // ...

Usage

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

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email katerinak@indeev.eu instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

  • 总下载量: 31
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固