3 # Manually (for now: TODO) add an entry in GameStat when a variant is added
4 # TODO: also delete lines in GameStat not matching a variant (removed ones...)
6 from dbconnect
import create_connection
10 (Incrementally) Synchronize GameStat table from Variants update
13 conn
= create_connection()
16 cur
.execute("SELECT max(vid) FROM GameStat");
17 vid_max
= cur
.fetchone()[0] or 0
18 cur
.execute("SELECT id FROM Variants WHERE id > ?", (vid_max
,))
21 cur
.execute("INSERT INTO GameStat(vid) VALUES (?)", (variant
[0],))