1

I have a Yii framework installed by Composer, webapp in public_html folder and all libraries in vendor folder:

webroot
|
|_public_html
|
|_vendor
  |
  |_fierwebdesign
    |
    |_yii-user
      |
      |_migrations

My configuration in console.php is:

'modules'=>array(
  'user'=>array(
     'hash' => 'md5',
      'sendActivationMail' => true,
      'loginNotActiv' => false,
      'activeAfterRegister' => false,
      'autoLogin' => true,
      'registrationUrl' => array('/user/registration'),
      'recoveryUrl' => array('/user/recovery'),
      'loginUrl' => array('/user/login'),
      'returnUrl' => array('/user/profile'),
      'returnLogoutUrl' => array('/user/login'),
    ),
),

When I try to run Yii-user extension's migrations, I'm getting error:

yiic.php migrate --migrationPath=vendor.fierwebdesign.yii-user.migrations

Error: The migration directory does not exist: vendor.fierwebdesign.yii-user.migrations

What am I doing wrong?

trejder
  • 17,148
  • 27
  • 124
  • 216

3 Answers3

1

You need declare vendor alias in configs. If your console.php in public_html/config/ than declaration is:

Yii::setPathOfAlias('vendor', dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' .
               DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_vendor');
CreatoR
  • 1,654
  • 10
  • 14
0

maybe this will help:

write something like this within the components array in the console.php config file;

    'commandMap' => array(
        'migrate' => array(
            'class' => 'system.cli.commands.MigrateCommand',
            'migrationPath' => 'application.modules.user.migrations',
//            'migrationTable' => 'tbl_migration',
            'connectionID' => 'db',
//            'templateFile' => 'application.migrations.template',
        ),

and then give the command : php migrate

also, the app/modules/user/migartion folder must exist in this case and must contain migratio files

Ionut Flavius Pogacian
  • 4,750
  • 14
  • 58
  • 100
  • No. Because Yii-user module not in folder modules.user. Yii-User installed in vendor.fierwebdesign.yii-user.migrations. If i write this with my path: Error: The migration directory does not exist: vendor.fierwebdesign.yii-user.migrations – Constantine Popov Oct 30 '13 at 13:08
0

Best guess is that migrationPath actually refers to a file system path instead of to an alias like you are using

acorncom
  • 5,975
  • 1
  • 19
  • 31