From bdb3f7f980c01ed934a68adbe831f2d325781dab Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Sun, 1 Oct 2017 11:56:21 +0200
Subject: use outer join for p_i for backwards compat

---
 crunch_global.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'crunch_global.sql')

diff --git a/crunch_global.sql b/crunch_global.sql
index 2b48958..173b6d9 100644
--- a/crunch_global.sql
+++ b/crunch_global.sql
@@ -35,7 +35,7 @@ select
     _p_i_item_uses_insert
 from participant p
 join participant_stats p_s on (p_s.participant_api_id = p.api_id)
-join participant_items p_i on (p_i.participant_api_id = p.api_id)
+left outer join participant_items p_i on (p_i.participant_api_id = p.api_id)
 join filter f on (f.dimension_on = 'global' and (f.name = 'all' or f.id in (select gpf.filter_id from global_point_filters gpf where gpf.match_api_id = p.match_api_id)))
 join series s on (p_s.created_at between s.start and s.end and s.dimension_on = 'global')
 join hero h on (p.hero_id = h.id or h.name = 'all')
-- 
cgit v1.3.1

