H
H
hollanditkzn2018-02-02 16:06:21
Yii
hollanditkzn, 2018-02-02 16:06:21

Why is the rbac migration failing?

I did as in the documentation and added the code to console/config/main.php

'components' => [
        'authMeneger' => [
            'class' => 'yii\rbac\DbManager',
        ],
        'log' => [
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
    ],

But it gives me an error
C:\OpenServer\domains\hostTraining>yii migrate [email protected]/rbac/migrations
Yii Migration Tool (based on Yii v2.0.13.1)

Total 2 new migrations to be applied:
        m140506_102106_rbac_init
        m170907_052038_rbac_add_index_on_auth_assignment_user_id

Apply the above migrations? (yes|no) [no]:yes
*** applying m140506_102106_rbac_init
Exception 'yii\base\InvalidConfigException' with message 'You should configure "authManager" component to use database before executing this migration.'

in C:\OpenServer\domains\hostTraining\vendor\yiisoft\yii2\rbac\migrations\m140506_102106_rbac_init.php:27

How to get rid of this problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question