summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKapil Viren Ahuja <kvahuja@users.noreply.github.com>2017-02-27 19:52:02 +0530
committerGitHub <noreply@github.com>2017-02-27 19:52:02 +0530
commit54a2760392bf8cedf1d96a8d27c8613288dc306c (patch)
treede82fae80c9269f77af2f5f9d8e50636cf5d9c62
parent44b9806c7efe850cdf4dfe93f5f91a27b3937156 (diff)
parentbcdb29305a18e4e2add7ce9c28fe481768bb5201 (diff)
downloadshrinker-54a2760392bf8cedf1d96a8d27c8613288dc306c.tar.gz
shrinker-54a2760392bf8cedf1d96a8d27c8613288dc306c.zip
Merge pull request #25 from vainglorygame/roster-match-ref
process roster's match_apiId
-rw-r--r--queries/roster.sql4
1 files changed, 3 insertions, 1 deletions
diff --git a/queries/roster.sql b/queries/roster.sql
index c61967b..2344c7f 100644
--- a/queries/roster.sql
+++ b/queries/roster.sql
@@ -1,8 +1,10 @@
WITH rosters AS (SELECT
+ id AS matchid,
JSONB_ARRAY_ELEMENTS(match.data->'relations') AS roster
FROM match WHERE id=$1)
SELECT
-roster->'data'->>'id' as "apiId",
+roster->'data'->>'id' AS "apiId",
+matchid AS "match_apiId",
(roster->'data'->'attributes'->'stats'->>'acesEarned')::int AS "acesEarned",
(roster->'data'->'attributes'->'stats'->>'gold')::int AS "gold",
(roster->'data'->'attributes'->'stats'->>'heroKills')::int AS "heroKills",