Home » Php » Is there any PHP framework's scaffolding that can generate migration like Ruby on Rails?

Is there any PHP framework's scaffolding that can generate migration like Ruby on Rails?

Posted by: admin July 12, 2020 Leave a comment

Questions:

In rails, when generating model, migration is created also.
I’m wondering any PHP framework can do it also?

I’m trying Yii framework now, but seems like I need to generate the migration manually first then generate a model. (or even a third step to generate CRUD :-/)

Thanks

How to&Answers:

I suggest you try fuelphp framework (http://fuelphp.com) which has excellent scaffold function as well as other amazing functions. It used PHP 5.3.

Answer:

CakePHP has a migrations plugin, as well as bake console which creates a file to generate your current schema and stuff. I think this might be what you need..

Answer:

I believe the old Yii dbmigrations extension is obsolete in favor of Yii’s built-in migration functions available since Yii 1.1.6: http://www.yiiframework.com/doc/guide/1.1/en/database.migration
However, it does seem like the OP may have tried that already as was not happy with the amount of manual work still involved compared to his experience with RoR.

Answer:

Doctrine 2 has a migrations component. It’s completely separate from the ORM, so you don’t have to be using Doctrine to use this. This is probably the most popular solution right now.

It does require php 5.3 though.