howyi / conv
从实际数据库和DDL生成MySQL迁移查询
v2.1.5
2024-03-21 14:56 UTC
Requires
- php: >=7.1
- ext-pdo: *
- composer/semver: ^1.4 || ^2.0 || ^3.0
- symfony/console: >=2.0
Requires (Dev)
- howyi/conv-test-suite: dev-master
- php-coveralls/php-coveralls: ^2.2
- phpspec/prophecy: ^1.7
- phpstan/phpstan: ^0.12.5
- phpunit/phpunit: ^6.2 || ^7.0
- squizlabs/php_codesniffer: ^3.0
- symfony/var-dumper: ^3.3
- dev-master
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.0
- v1.2.1
- v1.2.0
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-dependabot/composer/phpstan/phpstan-tw-0.12.5or-tw-1.0.0
- dev-fix-build
- dev-support-symfony5
- dev-add-maria-db
- dev-sql-parser
- dev-release/v2.0.0
- dev-v2-backup
- dev-master-fix-author
This package is auto-updated.
Last update: 2024-09-21 16:02:47 UTC
README
conv
是howyi/conv-laravel的核心包
从实际数据库和DDL生成MySQL迁移查询
composer require howyi/conv --dev
查询示例
tbl_user.sql
CREATE TABLE `tbl_user` ( `user_id` int(11) NOT NULL COMMENT 'User ID', `age` tinyint(3) UNSIGNED COMMENT 'User age', PRIMARY KEY (`user_id`), KEY `id_age` (`user_id`, `age`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='User management table';
生成的迁移
UP
CREATE TABLE `tbl_user` ( `user_id` int(11) NOT NULL COMMENT 'User ID', `age` tinyint(3) UNSIGNED COMMENT 'User age', PRIMARY KEY (`user_id`), KEY `id_age` (`user_id`, `age`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='User management table';
DOWN
DROP TABLE `tbl_user`;
贡献
安装
$ composer install
检查(在拉取请求之前)
$ composer check-fix