From ce1f18227b3b8e3d087e2b920151d63d0061fe33 Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Sun, 26 Feb 2017 12:20:05 +0100
Subject: pass object type to process job payload

---
 insert.sql | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'insert.sql')

diff --git a/insert.sql b/insert.sql
index be4dcae..abba48e 100644
--- a/insert.sql
+++ b/insert.sql
@@ -68,15 +68,15 @@
  insert_matches AS (
    INSERT INTO match SELECT * FROM linked_matches
    ON CONFLICT(id) DO NOTHING
-   RETURNING id -- TODO conflict shouldn't happen in prod
+   RETURNING type, id -- TODO conflict shouldn't happen in prod
  ),
  insert_players AS (
    INSERT INTO player SELECT * FROM linked_players
    ON CONFLICT(id) DO
    UPDATE SET attributes=EXCLUDED.attributes
    WHERE (player.attributes->'stats'->>'played')::int < (EXCLUDED.attributes->'stats'->>'played')::int
-   RETURNING id
+   RETURNING type, id
  )
- SELECT * FROM insert_matches
+ SELECT type, id FROM insert_matches
  UNION
- SELECT * FROM insert_players
+ SELECT type, id FROM insert_players
-- 
cgit v1.3.1

