fix: include column name in _ensure_columns ALTER TABLE

This commit is contained in:
blankie 2026-07-26 23:50:09 +00:00
parent 4207cd7f31
commit c98096c1ed

View file

@ -142,7 +142,7 @@ def _ensure_columns(db, table, columns):
existing = {r[1] for r in db.execute(f"PRAGMA table_info({table})").fetchall()}
for name, col_def in columns.items():
if name not in existing:
db.execute(f"ALTER TABLE {table} ADD COLUMN {col_def}")
db.execute(f"ALTER TABLE {table} ADD COLUMN {name} {col_def}")
def init_db():