diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-02-27 15:59:42 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-02-27 15:59:42 +0100 |
| commit | 3c420196975ac8bd5f77fefffc1539eba43e2785 (patch) | |
| tree | 707dca988c8c1bae8db0b8d79c84eda97150b6e7 | |
| parent | d039f8246106306b0f1c80050ad3d95dba00df23 (diff) | |
| download | shrinker-3c420196975ac8bd5f77fefffc1539eba43e2785.tar.gz shrinker-3c420196975ac8bd5f77fefffc1539eba43e2785.zip | |
reference from participant to roster
| -rw-r--r-- | queries/participant.sql | 2 |
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", |
