Skip to content
Snippets Groups Projects
Commit 6be61133 authored by Jared Hancock's avatar Jared Hancock
Browse files

orm: Propagate LEFT joins in join paths

If something like members__staff is considered leaving the Team model,
and the `members` relationship is nullable, and the `staff` relationship is
not, in the context of the compiled SQL statement, the second join should
also be considered nullable (LEFT join), because otherwise inconsistent
results would be returned from the query.

In other words, if a count is considered as an annotation to the Team model
instances, Teams with zero members should still be considered as valid teams
and should be selected with such an annotation. Before this patch, however,
the join between TeamMember and Staff would have been an inner join instead
of a LEFT join, which could skew the database results.
parent 5acdf568
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment