From 02c03bd1d9be9f1dfa79d0702d43f8314357b31f Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 18 Mar 2022 00:16:33 -0400 Subject: [PATCH] Use LEFT OUTER JOIN to include mods with 0 cell edits --- src/models/game_mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/game_mod.rs b/src/models/game_mod.rs index 20bc5d3..651a81e 100644 --- a/src/models/game_mod.rs +++ b/src/models/game_mod.rs @@ -398,8 +398,8 @@ pub async fn batched_get_cell_counts( mods.nexus_mod_id, COUNT(DISTINCT cells.*) FILTER (WHERE cells.x IS NOT NULL AND cells.y IS NOT NULL AND cells.master = $3 AND cells.world_id = $4) AS cells FROM mods - INNER JOIN plugin_cells ON plugin_cells.mod_id = mods.id - INNER JOIN cells ON cells.id = plugin_cells.cell_id + LEFT OUTER JOIN plugin_cells ON plugin_cells.mod_id = mods.id + LEFT OUTER JOIN cells ON cells.id = plugin_cells.cell_id WHERE mods.nexus_mod_id > $2 GROUP BY mods.nexus_mod_id ORDER BY mods.nexus_mod_id ASC