From 80d74af859f022d7734dc85dc64a7c742f139e94 Mon Sep 17 00:00:00 2001 From: Mike Montano Date: Sun, 17 Dec 2023 10:22:37 -0600 Subject: [PATCH] upgrade_db function always uses schema version defined internally --- logpyle/upgrade_db.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/logpyle/upgrade_db.py b/logpyle/upgrade_db.py index cb847cd..f1f8a3a 100644 --- a/logpyle/upgrade_db.py +++ b/logpyle/upgrade_db.py @@ -78,9 +78,10 @@ def upgrade_conn(conn: sqlite3.Connection) -> sqlite3.Connection: schema_version = 3 value = bytes(dumps(schema_version)) if gathered: - conn.execute("UPDATE runs SET schema_version=3") + conn.execute("UPDATE runs SET schema_version=?", + (schema_version,)) else: - conn.execute("UPDATE constants SET value = ? WHERE name='schema_version'", + conn.execute("UPDATE constants SET value=? WHERE name='schema_version'", (value,)) return conn