Append table name to Builder to prevent conflicting IDs in SQL query#139
Open
kyranb wants to merge 17 commits intompociot:masterfrom
Open
Append table name to Builder to prevent conflicting IDs in SQL query#139kyranb wants to merge 17 commits intompociot:masterfrom
IDs in SQL query#139kyranb wants to merge 17 commits intompociot:masterfrom
Conversation
Fixes the issue "Column 'id' in where clause is ambiguous" when using additional scopes.
Contributor
Author
|
Same issue here.. |
Contributor
Author
|
@mpociot Can this be merged in? I've been using the fork without issue in production for almost 1 year now :) |
Collaborator
|
@kyranb when the tests are green, we will consider merging it. |
Contributor
Author
|
@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. |
Collaborator
|
@kyranb please merge the current master in your feature branch so the latest test actions can run again. |
Contributor
Author
|
@okaufmann Sorry for the delay here Oliver. I've just done so :) |
Contributor
Author
|
@okaufmann @mpociot Can this be reviewed or merged? |
Contributor
Author
|
@mpociot @okaufmann Bump :) |
Jamesking56
approved these changes
Nov 26, 2024
Contributor
Author
|
Thanks @Jamesking56 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_idaspivot_team_id,tenants_user.user_idaspivot_user_id,tenants_user.created_ataspivot_created_at,tenants_user.updated_ataspivot_updated_atfromusersinner jointenants_useronusers.id=tenants_user.user_idwheretenants_user.team_id= 2 andid= 1 andusers.deleted_atis null limit 1)