Run initial RBAC migrations as part of a regular app migration

I have created a migrate.sh file where I put my migration commands that I need to run. This allows me to migrate from multiple places in the same time. It is quite simple, take a look here: https://github.com/Mihai-P/yii2-app-advanced/blob/master/migrate.sh

Instead of running ./yii migrate/up i just run sh migrate.sh that will update everything from any place.

The actual point of this is: you do not have to stick to exactly what Yii gave you. That is just a template for you to build on. Fork it, modify it, make it your own.


Try to add in console/config/main.php:

'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController',
            'migrationPath' => [
                '@console/migrations',               
                '@yii/rbac/migrations',
            ]
        ]
    ],