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( """