test(web): drop idx_sessions_effective_activity before emulating a pre-column store

The salvaged #95487 adds an expression index over sessions.last_activity_at.
Two web_server tests emulate a legacy store with ALTER TABLE ... DROP COLUMN
last_activity_at, which SQLite refuses while an index references the
column ('error in index ... after drop column'). Drop the index first —
the same adjustment the PR already made in test_schema_read_probe.py. A
real pre-column store has neither the column nor the index, so the healed
path under test is unchanged.
This commit is contained in:
kshitijk4poor
2026-09-03 04:17:47 +05:30
committed by kshitij
parent 98a6e4a90e
commit af964412d9
+4
View File
@@ -440,6 +440,9 @@ class TestWebServerEndpoints:
legacy = sqlite3.connect(str(db_path))
try:
# SQLite refuses DROP COLUMN while an index references the
# column; a pre-column legacy store has neither.
legacy.execute("DROP INDEX IF EXISTS idx_sessions_effective_activity")
legacy.execute(f"ALTER TABLE sessions DROP COLUMN {missing_column}")
legacy.commit()
finally:
@@ -486,6 +489,7 @@ class TestWebServerEndpoints:
legacy = sqlite3.connect(str(db_path))
try:
legacy.execute("DROP INDEX IF EXISTS idx_sessions_effective_activity")
legacy.execute("ALTER TABLE sessions DROP COLUMN last_activity_at")
legacy.commit()
finally: