migrations for advanced apps


I am using the advanced Yii 2.0.3 template. I have created a new app (alongside front and backend).

In the config of this new app I am overriding the ‘db’ config. As I am storing the source in git I want to save the migration files inside this app (and not in common/migrations).

When I try to migrate using ./yii migrate --migrationPath=@myapp/migrations errors are thrown as common does not have a ‘db’ configured.

Any ideas?

Thanks in advance

You need to configure a db connection in common\config\main-local.php ;)

you need to configure the database connection for console.php to be specific

Ok thanks, thought there might be a way to somehow pass the app id and determine the database connection.

Fixed it by loading the app’s main-local config in the console config. That way I do not need to worry about inconsistent config