tingobol / yii-rights

Automatically exported from code.google.com/p/yii-rights
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

'userid' field in AuthAssignment table is varchar #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue does not affect how Rights functions, but more of a suggestion to 
support interoperability with other extensions, e.g. yii-user.

If the 'userid' datatype is changed int(11), then you can create foreign key 
constraints so that when a user is deleted, the associated entry in the 
AuthAssignment table is deleted, e.g.

FOREIGN KEY (`userid`) REFERENCES `tbl_users` (`id`) ON DELETE CASCADE ON 
UPDATE CASCADE

This is not possible (as far as I know) if the datatypes are not matching.This 
is presumably only an issue with MySql with innodb.

P.S. thanks for you continued efforts on this excellent extension.

Original issue reported on code.google.com by rob.ande...@gtempaccount.com on 13 Jan 2011 at 8:07

GoogleCodeExporter commented 9 years ago
Actually, Rights uses the CDbAuthManager's schema.

You make a good point though. I don't see any problem in changing the type to 
integer. I still need to make sure that nothing is affected by this and maybe 
even ask Qiang why the field type was set to varchar.

Thanks for the positive feedback!

Original comment by Christof...@gmail.com on 15 Jan 2011 at 10:36

GoogleCodeExporter commented 9 years ago
Hello rob,

As I pointed out Rights uses the CDbAuthManager's schema so I won't change the 
provided schema, however feel free to change the data type in your application.

Original comment by Christof...@gmail.com on 31 Mar 2011 at 9:45