tables that I have:
users: id, name.
roles: id, name.
role_user: user_id, role_id, company_id.
the main idea is that user can have same roles but in different companies. for example:
user_id | role_id | company_id
______________________________
1 | 1 | 1
1 | 1 | 2
when I try sync()
, it stores only one row instead of two, because of user_id
and role_id
in both cases are same.
couldn't find solution, maybe it's my bad that I couldn't provide correct sentence to search :)