Migrations from modules are not performed by the yiic migrate command

I am trying to install a custom module in my Yii based application. To do this, I need to transfer files from:

webapp/protected/modules/user/migrations 

I try to run yiic migrate --migrationPath=user.migrations , but I get an error:

 the migration directory does not exist: user.migrations 

I read that I need to configure user.migrations as an alias, but I don't know how to do it.

I also read that the default folder for migration is determined by the basePath value set in the main configuration file ( protected/config/main.php ). I changed it and it still does not work correctly.

What could be wrong?

+7
source share
4 answers

Try the following:

yiic migrate --migrationPath=application.modules.user.migrations

+12
source

From the command line, open yiic of your protected folder . Not applicable to the frame folder.

+4
source

If someone cannot make it work, here are some details:

Usage: ./ yiic migrate --migrationPath = application.dirName.migrations

How did it happen? Check out the MigrateCommand class. The public property $ migrationPath = 'application.migrations', where "application" will become "/ home / yourUser / yourYiiApp / protected / and" migrations ", will become" well tolerated "after it is parsed. So, if you work. / yiic just point to dirname / migrationFolder

+3
source

In case someone else struggles with this, I had to go into a protected folder and force it to use the correct yiic with:

php yiic.php migrate --migrationPath=application.modules.user.migrations

+1
source

All Articles