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,
"INSERT INTO games (id, num_players, variant_id, seed, score, num_turns, datetime_started, datetime_finished) "
"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
)
psycopg2.extras.execute_values(