bizley / yii2-migration

Yii 2 Migration Creator And Updater
Apache License 2.0
291 stars 36 forks source link

Exception 'TypeError' with message 'Argument 1 passed to MigrationController::preparePathDirectory() must be of the type string, array given #55

Closed tonykor closed 5 years ago

tonykor commented 5 years ago

I'm getting an error

# php yii migration/create-all
Exception 'TypeError' with message 'Argument 1 passed to bizley\migration\controllers\MigrationController::preparePathDirectory() must be of the type string, array given, called in /basic/vendor/bizley/migration/src/controllers/MigrationController.php on line 295'

in /basic/vendor/bizley/migration/src/controllers/MigrationController.php:321

Stack trace:
#0 /basic/vendor/bizley/migration/src/controllers/MigrationController.php(295): bizley\migration\controllers\MigrationController->preparePathDirectory(Array)
#1 /basic/vendor/yiisoft/yii2/base/Controller.php(155): bizley\migration\controllers\MigrationController->beforeAction(Object(yii\base\InlineAction))
#2 /basic/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('create-all', Array)
#3 /basic/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('create-all', Array)
#4 /basic/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migration/creat...', Array)
#5 /basic/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migration/creat...', Array)
#6 /basic/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#7 /basic/yii(19): yii\base\Application->run()
#8 {main}

config

      'migration' => [
            'class' => 'bizley\migration\controllers\MigrationController',
            'migrationPath' => [
                '@console/migrations',               
                '@yii/rbac/migrations',
            ]
        ],
bizley commented 5 years ago

The same applies to migrationNamespace.

bizley commented 5 years ago

After thinking of it a bit more yesterday - this is not a bug. These properties are clearly stated to be strings so you can not put array there only because property of the same name but in different class can be array. So I'm removing bug label.

At the same time we need to have some way of adding arrays for migration updater and this should be what the issue is about. Anyway, result will be the same.

bizley commented 5 years ago

Added in 3.5.0/2.8.0