From f72d816f8d5bb6f363b1ae43debdcff4dafef074 Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Tue, 7 Feb 2017 20:46:16 +0100
Subject: remove code not related to API data fetching

---
 queries/recent-matches.sql | 30 ------------------------------
 1 file changed, 30 deletions(-)
 delete mode 100644 queries/recent-matches.sql

(limited to 'queries/recent-matches.sql')

diff --git a/queries/recent-matches.sql b/queries/recent-matches.sql
deleted file mode 100644
index 1bde01b..0000000
--- a/queries/recent-matches.sql
+++ /dev/null
@@ -1,30 +0,0 @@
-﻿SELECT ARRAY_TO_JSON(ARRAY(
-SELECT
-  JSONB_BUILD_OBJECT(
-  'id', (match.data->'attributes'->>'shardId') || (match.data->>'id'),
-  'date', match.data->'attributes'->>'createdAt',
-  'duration', CAST(
-    match.data->'attributes'->>'duration'
-    AS INTEGER),
-  'teams', ARRAY(
-    SELECT(
-      SELECT
-      JSONB_BUILD_OBJECT(
-      'id', roster.data->>'id',
-      'side', roster.data->'attributes'->'stats'->>'side',
-      'kills', roster.data->'attributes'->'stats'->>'heroKills',
-      'players', ARRAY(
-        SELECT(
-          SELECT
-            participant.data->'attributes'->>'actor'
-          FROM participant WHERE relparticipant->>'id' = participant.data->>'id')
-        FROM JSONB_ARRAY_ELEMENTS(roster.data->'relationships'->'participants'->'data') relparticipant
-      )
-      )
-      FROM roster WHERE relroster->>'id' = roster.data->>'id')
-    FROM JSONB_ARRAY_ELEMENTS(match.data->'relationships'->'rosters'->'data') relroster
-  )
-)
-FROM match
-ORDER BY match.data->'attributes'->>'createdAt' DESC
-)) AS data;
-- 
cgit v1.3.1

