fix: include column name in _ensure_columns ALTER TABLE
This commit is contained in:
parent
4207cd7f31
commit
c98096c1ed
1 changed files with 1 additions and 1 deletions
|
|
@ -142,7 +142,7 @@ def _ensure_columns(db, table, columns):
|
||||||
existing = {r[1] for r in db.execute(f"PRAGMA table_info({table})").fetchall()}
|
existing = {r[1] for r in db.execute(f"PRAGMA table_info({table})").fetchall()}
|
||||||
for name, col_def in columns.items():
|
for name, col_def in columns.items():
|
||||||
if name not in existing:
|
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():
|
def init_db():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue