mdmsoft / yii2-admin

Auth manager for Yii2 (RBAC Manager)
GNU General Public License v3.0
1.16k stars 577 forks source link

When rename item, this still keep in database (v3.2) #223

Closed sashsvamir closed 8 years ago

sashsvamir commented 8 years ago

When i try to rename any items (assignment, role, permission), this item still stay at database, also relations of these items (child) still in db. Can this behaviour give any problems in future? Right now i can see first problem of this behaviour: if you add in future any item (role, permission or assignment) with same name, which was renamed before, you get all relations of older items with same name.

sashsvamir commented 8 years ago

Also problem happens when you delete item: all relations of these item still keep in database.

sashsvamir commented 8 years ago

Oh, i'm sorry, problem was in configuration of mysql database (my.cnf), this config was disabling InnoDb engine by set active key skip-innodb. The task of removing (and renaming) items from RBAC tables call from DbManager class of Yii2 and implements by 'Cascade Update' feature (by using foreign key of mysql table). Because foreign keys supported only by InnoDb, this Cascade Updating not happens. Now problem was fixed and all works as intended.