From 5df8cc227bf8969fa4d9eca5a67b38b43be91b5b Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Sun, 12 Mar 2017 13:01:58 +0100
Subject: player: insert skill_tier

---
 queries/player.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'queries/player.sql')

diff --git a/queries/player.sql b/queries/player.sql
index 209aabb..d718391 100644
--- a/queries/player.sql
+++ b/queries/player.sql
@@ -9,6 +9,7 @@ participants AS (SELECT
   JSONB_ARRAY_ELEMENTS(rosters.roster->'relations') AS participant
 FROM rosters),
 players AS (SELECT
+  participants.participant->'data'->'attributes'->'stats'->>'skillTier' AS skill_tier,
   shardid,
   matchdate,
   JSONB_ARRAY_ELEMENTS(participants.participant->'relations') AS player
@@ -27,7 +28,7 @@ players.player->'data'->'attributes'->>'name' AS "name",
 (players.player->'data'->'attributes'->'stats'->>'wins')::int AS "wins",
 (players.player->'data'->'attributes'->'stats'->>'lifetimeGold')::float AS "lifetime_gold",
 matchdate AS "last_match_created_date",
-
+skill_tier AS "skill_tier",
 0 AS "streak"
 
 FROM players
-- 
cgit v1.3.1

