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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user