Closed battika closed 9 years ago
In your database in auth_assignment table you can change user_id to be integer, or how you call it serial. This has nothing to do with template, if you were using rbac migration provided by yii2 developers (like I did) sooner or later you would get the same error. I can change rbac migration in my templates and update auth_assignment user_id to be integer so you will not have problems on PostgreSQL. hope it will not cause some other problems, at least it shouldn't... Thanks for reporting and please tell me does this fix helps.
Hello @nenad-zivkovic , you are right. I go ahead and report this on the yii2 repository and see why they chose varchar and not integer. Thank you.
I have released version 1.2.1 that is fixing this issue by changing auth_assignment user_id field to integer type. I think that there is no real reason for it to be varchar. Maybe the creator of original migration was thining that someone may use some other data as user_id like username or something like that, but I think that integer is better option anyway.
Thank you
Hello,
I'm getting the following error when visiting the Users page (using PostgreSQL):
It is caused by the following line in UserController.php file:
It's because user.id is a serial while auth_assignment.user_id is a varchar by definition. PostgreSQL will not allow to use the "=" operator with arguments of different types.