- let mut query = post_aggregates::table
- .inner_join(person::table)
- .inner_join(post::table)
- .inner_join(community::table)
- .left_join(
- community_person_ban::table.on(
- post_aggregates::community_id
- .eq(community_person_ban::community_id)
- .and(community_person_ban::person_id.eq(post_aggregates::creator_id)),
- ),
- )
- .left_join(
- community_follower::table.on(
- post_aggregates::community_id
- .eq(community_follower::community_id)
- .and(community_follower::person_id.eq(person_id_join)),
- ),
- )
- .left_join(
- community_moderator::table.on(
- post::community_id
- .eq(community_moderator::community_id)
- .and(community_moderator::person_id.eq(person_id_join)),
- ),
- )
- .left_join(
- post_saved::table.on(
- post_aggregates::post_id
- .eq(post_saved::post_id)
- .and(post_saved::person_id.eq(person_id_join)),
- ),
- )
- .left_join(
- post_read::table.on(
- post_aggregates::post_id
- .eq(post_read::post_id)
- .and(post_read::person_id.eq(person_id_join)),
- ),
- )
- .left_join(
- person_block::table.on(
- post_aggregates::creator_id
- .eq(person_block::target_id)
- .and(person_block::person_id.eq(person_id_join)),
- ),
- )