From 07dd572a1f61cb5feb3af84c20945a2b0d9b2f84 Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Sun, 26 Feb 2017 13:30:41 +0100
Subject: fix participants not being linked into roster

---
 insert.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'insert.sql')

diff --git a/insert.sql b/insert.sql
index be4dcae..a47906e 100644
--- a/insert.sql
+++ b/insert.sql
@@ -39,7 +39,7 @@
      'data', rosters.data - 'relationships',
      'relations', TO_JSONB(ARRAY(
        SELECT * FROM linked_participants
-       WHERE rosters.data->'relationships'->'participants'->'data' @> JSONB_BUILD_ARRAY(JSONB_BUILD_OBJECT('id', linked_participants.data->>'id', 'type', linked_participants.data->>'type'))
+       WHERE rosters.data->'relationships'->'participants'->'data' @> JSONB_BUILD_ARRAY(JSONB_BUILD_OBJECT('id', linked_participants.data->'data'->>'id', 'type', linked_participants.data->'data'->>'type'))
      ))
    ) AS data
    FROM rosters
-- 
cgit v1.3.1

