track switches by player
This commit is contained in:
parent
ef70128552
commit
e1b5d3abb0
10
main.py
10
main.py
@ -46,8 +46,8 @@ def _init_db(conn: sqlite3.Connection):
|
|||||||
UNIQUE(game, turn, player, user)
|
UNIQUE(game, turn, player, user)
|
||||||
);
|
);
|
||||||
CREATE TABLE IF NOT EXISTS switches(
|
CREATE TABLE IF NOT EXISTS switches(
|
||||||
game, turn, name,
|
game, turn, player, name,
|
||||||
UNIQUE(game, turn, name)
|
UNIQUE(game, turn, player, name)
|
||||||
);
|
);
|
||||||
CREATE TABLE IF NOT EXISTS nicknames(
|
CREATE TABLE IF NOT EXISTS nicknames(
|
||||||
game, player, name, specie,
|
game, player, name, specie,
|
||||||
@ -100,11 +100,11 @@ def parse_log(game: str, log: str, into: sqlite3.Connection):
|
|||||||
player, name = resolve_mon(name)
|
player, name = resolve_mon(name)
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"""
|
"""
|
||||||
INSERT INTO switches(game, turn, name)
|
INSERT INTO switches(game, turn, player, name)
|
||||||
VALUES (?, ?, ?)
|
VALUES (?, ?, ?, ?)
|
||||||
ON CONFLICT DO NOTHING
|
ON CONFLICT DO NOTHING
|
||||||
""",
|
""",
|
||||||
(game, turn, name),
|
(game, turn, player, name),
|
||||||
)
|
)
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user