yii2使用magrate新增权限流程

2019-09-02 16:09:21 浏览数 (1)

yii2使用magrate新增权限流程:

1、到项目根目录(必须是项目环境中,如我的是在虚拟机中:[root@localhost crm]# php ./yii migrate/create user_rbac)执行指令:php ./yii migrate/create 文件名;

显示一下说明成功:

Create new migration '/media/psf/crm/console/migrations/m190828_053939_user_rbac.php'? (yes|no) [no]:yes New migration created successfully.

2、执行:php ./yii migrate

[root@localhost crm]# php ./yii migrate Yii Migration Tool (based on Yii v2.0.15.1)

Total 1 new migration to be applied: m190828_053939_user_rbac

Apply the above migration? (yes|no) [no]:yes *** applying m190828_053939_user_rbac *** applied m190828_053939_user_rbac (time: 0.040s)

1 migration was applied.

3、执成功会在表“administrator_auth_item”生成对应的权限数据

0 人点赞