summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-02-27 15:21:12 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-02-27 15:21:12 +0100
commitbcdb29305a18e4e2add7ce9c28fe481768bb5201 (patch)
tree6e6cfbabae831fde9ea53ba869bb4222e309d1fb
parent2a0d6028757600f9761d81bdd647b3b59cb47495 (diff)
downloadprocessor-bcdb29305a18e4e2add7ce9c28fe481768bb5201.tar.gz
processor-bcdb29305a18e4e2add7ce9c28fe481768bb5201.zip
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",