summaryrefslogtreecommitdiff
path: root/queries/participant.sql
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-02-27 18:18:36 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-02-27 18:18:36 +0100
commite146deb38fcd2589463bd376979a816c1a8ee9f0 (patch)
tree87ce516a72d4cfcbfa890ce61c04a7580cafae4a /queries/participant.sql
parentf1ef91b02be7e9e608af017f0115b74df5160a2a (diff)
parent3c420196975ac8bd5f77fefffc1539eba43e2785 (diff)
downloadprocessor-e146deb38fcd2589463bd376979a816c1a8ee9f0.tar.gz
processor-e146deb38fcd2589463bd376979a816c1a8ee9f0.zip
Merge branch 'participant-roster-ref' into develop
Diffstat (limited to 'queries/participant.sql')
-rw-r--r--queries/participant.sql2
1 files changed, 2 insertions, 0 deletions
diff --git a/queries/participant.sql b/queries/participant.sql
index e11179c..7022d90 100644
--- a/queries/participant.sql
+++ b/queries/participant.sql
@@ -2,11 +2,13 @@ WITH rosters AS (SELECT
JSONB_ARRAY_ELEMENTS(match.data->'relations') AS roster
FROM match WHERE id=$1),
participants AS (SELECT
+ rosters.roster->'data'->>'id' AS rosterid,
JSONB_ARRAY_ELEMENTS(rosters.roster->'relations') AS participant
FROM rosters)
SELECT
participant->'data'->>'id' AS "apiId",
+rosterid AS "roster_apiId",
participant->'relations'->0->'data'->>'id' AS "player_apiId",
participant->'data'->'attributes'->>'actor' AS "hero",