fix(task7): invalidate tokens on password change or reset

This commit is contained in:
Atharv1705
2026-11-17 18:31:45 +05:30
parent b8639bc52a
commit 9276064d18
11 changed files with 145 additions and 4 deletions
+4 -1
View File
@@ -38,7 +38,10 @@ def run_sqlite_migrations(engine: Engine) -> None:
for col in table.columns:
if col.name not in existing_cols:
col_type = col.type.compile(engine.dialect)
sql = f"ALTER TABLE {table_name} ADD COLUMN {col.name} {col_type}"
if col.name == "token_version":
sql = f"ALTER TABLE {table_name} ADD COLUMN {col.name} INTEGER DEFAULT 0 NOT NULL"
else:
sql = f"ALTER TABLE {table_name} ADD COLUMN {col.name} {col_type}"
logger.info("Auto-migrating SQLite: %s", sql)
conn.exec_driver_sql(sql)
except Exception: