Skip to content

Commit

Permalink
upgrade_db function always uses schema version defined internally
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgesFTW committed Dec 17, 2023
1 parent 0e64ec0 commit 80d74af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions logpyle/upgrade_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80d74af

Please sign in to comment.