Using Yii2 migrations in Symfony

Hi,

I’m new to Yii, but based on the recommendation of an experienced Yii user I’d like to use Yii2 migrations in my Symfony projects. This is mainly because they support going and back and forward 1,2,3 steps, rather than requiring to know the datestamp in doctrine migrations.

To get this going I first tried to install yiisoft/yii2 with composer. What I found however is that all migrations are then created in my vendor folder: /vendor/yiisoft/yii2/console/migrations

I could not find any documentation on how to configure different folders for this.

As a second step I created a Yii application and then simply copied some files around. I’d like to have feedback if there is a better way to do this.

My steps

  • add missing composer.json entries to my symfony composer.json and run composer update

  • copy yii file to symfony root folder as yiic

  • copy config folder to symfony root

  • configure database in config/db.php

Any feedback would be appreciated

There’s https://github.com/yiisoft/yii2/blob/master/framework/console/controllers/BaseMigrateController.php#L44 property with default value of @app/migrations. I guess you need to set it.