Correctly exclude sandboxed ratings from gameRatingsSandbox0
#1264
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.
Prior to #1256, we were excluding special reviews, embargoed reviews, and sandboxed reviews with a
whereclause, but this meant that some games were missing fromgameRatingsSandbox0, when all of a game's reviews were special reviews. In #1256, I removed thewhereclause and turned them into criteria on thejoinclauses.This worked fine for special reviews and embargoed reviews, but it didn't work for sandboxed reviews. We did a left join to the
userstable, excluding sandboxed users there, but we didn't use the results of that join. We never usedusers.useridfor anything, and we never excluded any sandboxed reviews in the criteria for thereviewstable.I've removed the join to
usersand replaced it with another criterion on the join to thereviewstable, excluding reviews where theuseridis sandboxed.I've confirmed that this still excludes special and embargoed reviews, and now it excludes sandboxed reviews, too. Also, I've confirmed that the number of rows matches the number of rows in the games table, so every game has a matching row in
gameRatingsSandbox0.Fixes #1263
This is impossible-ish to test for folks who don't have access to the prod database (containing the actual sandboxed users), but:
before
after