fix update

This commit is contained in:
Maximilian Keßler 2023-12-26 18:01:35 +01:00
parent 7a44378e9e
commit 42b103343c
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -161,7 +161,9 @@ def store_new_games(games: List[GameInfo]):
cur, cur,
"INSERT INTO games (id, num_players, variant_id, seed, score, num_turns, datetime_started, datetime_finished) " "INSERT INTO games (id, num_players, variant_id, seed, score, num_turns, datetime_started, datetime_finished) "
"VALUES %s " "VALUES %s "
"ON CONFLICT (id) DO NOTHING", "ON CONFLICT (id) DO UPDATE SET"
"(num_players, variant_id, seed, score, num_turns, datetime_started, datetime_finished)"
"=(excluded.num_players, excluded.variant_id, excluded.seed, excluded.score, excluded.num_turns, excluded.datetime_started, excluded.datetime_finished)",
games_vals games_vals
) )
psycopg2.extras.execute_values( psycopg2.extras.execute_values(