From b7e442270e0427c8ebf0d246edd91c26d1ad37a1 Mon Sep 17 00:00:00 2001
From: kvahuja <k.v.ahuja@gmail.com>
Date: Fri, 17 Feb 2017 21:08:14 +0530
Subject: match and roster tables refactored

---
 queries/roster.sql | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 queries/roster.sql

(limited to 'queries/roster.sql')

diff --git a/queries/roster.sql b/queries/roster.sql
new file mode 100644
index 0000000..b5c4dff
--- /dev/null
+++ b/queries/roster.sql
@@ -0,0 +1,17 @@
+SELECT
+
+id AS "apiId",
+(attributes->'stats'->>'acesEarned')::int AS "acesEarned",
+(attributes->'stats'->>'gold')::int AS "gold",
+(attributes->'stats'->>'heroKills')::int AS "heroKills",
+(attributes->'stats'->>'krakenCaptures')::int AS "krakenCaptures",
+attributes->'stats'->>'side' AS "side",
+attributes->'stats'->>'side' AS "teamColor",
+(attributes->'stats'->>'turretKills')::int AS "turretKills",
+(attributes->'stats'->>'turretsRemaining')::int AS "turretsRemaining",
+
+relationships->'participants'->'data'->0->>'id' AS "participant_1",
+relationships->'participants'->'data'->1->>'id' AS "participant_2",
+relationships->'participants'->'data'->2->>'id' AS "participant_3"
+
+FROM roster
-- 
cgit v1.3.1

