firevel/mysql-to-spanner
Composer 安装命令:
composer require firevel/mysql-to-spanner
包简介
Laravel tool to convert MySQL schemas to Cloud Spanner Data Definition Language (DDL)
关键字:
README 文档
README
Migrating from MySQL to Cloud Spanner
Start here: Migrating from MySQL to Cloud Spanner.
Make sure that:
- All tables got primary keys.
AUTO_INCREMENTcan be ignored (not supported by Cloud Spanner).
Installation
You can install the package via composer:
composer require firevel/mysql-to-spanner
Usage
MySQL dump
You can dump your MySQL database using command:
php artisan db:spanner-dump
Parameters supported:
- Use
--connectionto specify source (MySQL) connection name. - Use
--fileto specify output ex.:php artisan db:spanner-dump --file=storage/spanner-ddl.txt. - Use
--disktogether with--fileto save output in storage defined in/config/filesystems.php, ex.:php artisan db:spanner-dump --disk=gcs --file=exports/spanner-ddl.txt. - Use
--ignore-tableto specify tables to ignore during dump, ex:php artisan db:spanner-dump --ignore-table=password_resets,php artisan db:spanner-dump --ignore-table=tmp_*,php artisan db:spanner-dump --ignore-table=table1,table2. - Use
--default-primary-keyto specify default primary key ex.:php artisan db:spanner-dump --default-primary-key=id. - Use
--onlyto specify tables to export ex.:php artisan db:spanner-dump --only=table1,table2.
MySQL to Spanner migration
You can migrate your MySQL data to Spanner using command:
php artisan db:spanner-migrate
By default only schema will be migrated, if you would like to migrate schema and data run:
php artisan db:spanner-migrate --data
Parameters supported:
- Use
--connectionto specify source (MySQL) connection name. - Use
--spanner-connectionto specify connection name (spannerby default). - Use
--freshto delete database before creating schemas. - Use
--datato migrate rows. - Use
--chunk-sizeto specify chunk size used in data migration. - Use
--schema=falseto skip schema migration. - Use
--ignore-tableto specify tables to ignore during dump, ex:php artisan db:spanner-dump --ignore-table=password_resets,php artisan db:spanner-dump --ignore-table=tmp_*,php artisan db:spanner-dump --ignore-table=table1,table2. - Use
--default-primary-keyto specify default primary key ex.:php artisan db:spanner-dump --default-primary-key=id. - Use
--onlyto specify tables to export ex.:php artisan db:spanner-dump --only=table1,table2.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 154
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-18