php 将已有数据库导出生成migrate文件

依赖包 安装

composer require --dev "xethron/migrations-generator"

laravel 5 及以上 ,Laravel 4:https://github.com/xethron/Laravel-4-Generators.git

编辑 Laravel config/app.php文件,添加Provider

Way\Generators\GeneratorsServiceProvider::class,
Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class,

laravel 6 可能不需要此步骤

命令行中操作 php artisan migrate:generate 根据提示即可完成导出工作。

依赖包地址:https://github.com/Xethron/migrations-generator

你可能感兴趣的:(php 将已有数据库导出生成migrate文件)