Chapter 8. RBAC roles to project


While writing this note, I found the reason of the problem and just publishing in case somebody happen to hit the same rock ;)

BTW, I’m aware that it is not Yii specific, but when attempting to create the tbl_project_user_role of the Chapter in reference, I got an SQL:150 error

I narrow it down to the "role" foreign key that for some reason was being rejected, two issues to look for:

  • Foreign Key Constrains (at least for InnoDb) require that tables involved use the same engine , no surprise !

  • Also, check that the actual field not only matches the type and size but also the encoding

cheers hope this helps,


"One is glad to be of service" - I.Asimov from "Bicentennial Man"