Skip to content

Conversation

@kyranb
Copy link
Contributor

@kyranb kyranb commented Sep 25, 2021

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 as pivot_team_id, tenants_user.user_id as pivot_user_id, tenants_user.created_at as pivot_created_at, tenants_user.updated_at as pivot_updated_at from users inner join tenants_user on users.id = tenants_user.user_id where tenants_user.team_id = 2 and id = 1 and users.deleted_at is null limit 1)

Fixes the issue "Column 'id' in where clause is ambiguous" when using additional scopes.
@kyranb
Copy link
Contributor Author

kyranb commented Oct 8, 2021

@mpociot

@rodriguezaitor
Copy link

Same issue here..

@kyranb
Copy link
Contributor Author

kyranb commented Jul 11, 2022

@mpociot Can this be merged in? I've been using the fork without issue in production for almost 1 year now :)

@okaufmann
Copy link
Collaborator

@kyranb when the tests are green, we will consider merging it.

@kyranb
Copy link
Contributor Author

kyranb commented Aug 25, 2022

@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.

@okaufmann
Copy link
Collaborator

@kyranb please merge the current master in your feature branch so the latest test actions can run again.

@kyranb
Copy link
Contributor Author

kyranb commented Aug 11, 2023

@okaufmann Sorry for the delay here Oliver. I've just done so :)

@kyranb
Copy link
Contributor Author

kyranb commented Sep 25, 2023

@okaufmann @mpociot Can this be reviewed or merged?

@kyranb
Copy link
Contributor Author

kyranb commented Nov 9, 2023

@mpociot @okaufmann Bump :)

@kyranb
Copy link
Contributor Author

kyranb commented Dec 4, 2024

Thanks @Jamesking56 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants