From 259dc118f12083fb3040bf8407e903e02579fe57 Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+github@schneefux.xyz>
Date: Sun, 5 Mar 2017 10:36:28 +0100
Subject: run jobs in batches (#7)

* run jobs in batches

* upsert player_stats
---
 queries/player/count_player_matches.sql | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'queries/player/count_player_matches.sql')

diff --git a/queries/player/count_player_matches.sql b/queries/player/count_player_matches.sql
index fbdd283..226cacc 100644
--- a/queries/player/count_player_matches.sql
+++ b/queries/player/count_player_matches.sql
@@ -25,3 +25,5 @@ select
 )
 INSERT INTO player_stats(player_api_id, patch_version, played, wins, casual_played, casual_wins, ranked_played, ranked_wins, streak)
     SELECT * FROM stats
+ON CONFLICT(player_api_id) DO
+    UPDATE SET (player_api_id, patch_version, played, wins, casual_played, casual_wins, ranked_played, ranked_wins, streak) = (SELECT * FROM stats)
-- 
cgit v1.3.1

