Generating migration from existing database in Yii or Laravel

后端 未结 9 923
南方客
南方客 2021-01-31 05:39

I\'m working on a project that has a fairly complex database (150+ tables). In order to be able to maintain changes, I\'ve decided to add migrations, preferably using Yii or Lar

9条回答
  •  庸人自扰
    2021-01-31 06:36

    After doing some research, here's what you're going to need for Laravel: https://github.com/XCMer/larry-four-generator

    (version 4 at least, who knows how long this will work, Laravel changes too fast and has too many breaking changes)

    You'll want to run php artisan larry:fromdb and it'll show you the tables...You can also exclude or only process certain tables (look at the readme).

    Again, super super useful if you like to build your schema in something like MySQL Workbench. I also saw mention of a package that would parse the workbench files...But the link was dead.

    You may also wish to use this larry package with: https://github.com/JeffreyWay/Laravel-4-Generators

    You can then create scaffolding a la CakePHP style.

    Alternatively, try this package: https://github.com/barryvdh/laravel-migration-generator

提交回复
热议问题