Open kyranb opened 3 years ago
@mpociot
Same issue here..
@mpociot Can this be merged in? I've been using the fork without issue in production for almost 1 year now :)
@kyranb when the tests are green, we will consider merging it.
@okaufmann Can you take a look? I'm not that familiar with mockery, but it looks like just the table name (users) needs to be added in somewhere as the query now includes that.
@kyranb please merge the current master in your feature branch so the latest test actions can run again.
@okaufmann Sorry for the delay here Oliver. I've just done so :)
@okaufmann @mpociot Can this be reviewed or merged?
@mpociot @okaufmann Bump :)
Fixes the issue "Column 'id' in where clause is ambiguous" when using additional scopes.
Example query that fails due to not specifying the table name for
id
:SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous (SQL: select
users
.*,tenants_user
.team_id
aspivot_team_id
,tenants_user
.user_id
aspivot_user_id
,tenants_user
.created_at
aspivot_created_at
,tenants_user
.updated_at
aspivot_updated_at
fromusers
inner jointenants_user
onusers
.id
=tenants_user
.user_id
wheretenants_user
.team_id
= 2 andid
= 1 andusers
.deleted_at
is null limit 1)