From 2ba860f0452ce4147b845db75d79014d059c27ec Mon Sep 17 00:00:00 2001
From: Kapil Viren Ahuja <k.v.ahuja@gmail.com>
Date: Sat, 4 Mar 2017 11:42:14 +0530
Subject: Col case changes

---
 queries/player.sql | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'queries/player.sql')

diff --git a/queries/player.sql b/queries/player.sql
index 0619ee6..585858d 100644
--- a/queries/player.sql
+++ b/queries/player.sql
@@ -1,5 +1,5 @@
 WITH rosters AS (SELECT
-  match.data->'data'->'attributes'->>'createdAt' AS matchdate,
+  match.data->'data'->'attributes'->>'created_at' AS matchdate,
   JSONB_ARRAY_ELEMENTS(match.data->'relations') AS roster
 FROM match WHERE id=$1),
 participants AS (SELECT
@@ -13,16 +13,16 @@ FROM participants)
 
 SELECT
 
-players.player->'data'->>'id' AS "apiId",
+players.player->'data'->>'id' AS "api_id",
 players.player->'data'->'attributes'->>'name' AS "name",
 (players.player->'data'->'attributes'->'stats'->>'level')::int AS "level",
 (players.player->'data'->'attributes'->'stats'->>'xp')::int AS "xp",
 (players.player->'data'->'attributes'->'stats'->>'played')::int AS "played",
-(players.player->'data'->'attributes'->'stats'->>'played_ranked')::int AS "playedRanked",
-(players.player->'data'->'attributes'->'stats'->>'played')::int - (players.player->'data'->'attributes'->'stats'->>'played_ranked')::int AS "playedCasual",
+(players.player->'data'->'attributes'->'stats'->>'played_ranked')::int AS "played_ranked",
+(players.player->'data'->'attributes'->'stats'->>'played')::int - (players.player->'data'->'attributes'->'stats'->>'played_ranked')::int AS "played_casual",
 (players.player->'data'->'attributes'->'stats'->>'wins')::int AS "wins",
-(players.player->'data'->'attributes'->'stats'->>'lifetimeGold')::float AS "lifetimeGold",
-CASE WHEN players.player->'data'->'attributes'->>'name'=$2 THEN matchdate ELSE 'epoch'::timestamp::text END AS "lastMatchCreatedDate",
+(players.player->'data'->'attributes'->'stats'->>'lifetimeGold')::float AS "lifetime_gold",
+CASE WHEN players.player->'data'->'attributes'->>'name'=$2 THEN matchdate ELSE 'epoch'::timestamp::text END AS "last_match_created_date",
 
 0 AS "streak"
 
-- 
cgit v1.3.1

