From e1b5d3abb0c8dfc58b038aa22fc177ecab00f04a Mon Sep 17 00:00:00 2001 From: xeals Date: Mon, 27 Mar 2023 20:19:58 +1100 Subject: [PATCH] track switches by player --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index fd88673..05b2ac4 100755 --- a/main.py +++ b/main.py @@ -46,8 +46,8 @@ def _init_db(conn: sqlite3.Connection): UNIQUE(game, turn, player, user) ); CREATE TABLE IF NOT EXISTS switches( - game, turn, name, - UNIQUE(game, turn, name) + game, turn, player, name, + UNIQUE(game, turn, player, name) ); CREATE TABLE IF NOT EXISTS nicknames( game, player, name, specie, @@ -100,11 +100,11 @@ def parse_log(game: str, log: str, into: sqlite3.Connection): player, name = resolve_mon(name) conn.execute( """ - INSERT INTO switches(game, turn, name) - VALUES (?, ?, ?) + INSERT INTO switches(game, turn, player, name) + VALUES (?, ?, ?, ?) ON CONFLICT DO NOTHING """, - (game, turn, name), + (game, turn, player, name), ) conn.execute( """