Description
The downgrade() function in migration 6c0e5f8a9b1d_add_gateway_lifecycle_fields.py uses individual op.drop_column() calls which fail on SQLite versions prior to 3.35.0 when not inside a batch_alter_table context.
Reproduction
On SQLite less than 3.35.0:
- alembic upgrade head
- alembic downgrade -1 # FAILS: SQLite does not support DROP COLUMN outside batch mode
Expected behavior
downgrade -1 should succeed on SQLite by wrapping drop_column calls inside batch_alter_table.
Fix
Replace the per-column op.drop_column loop with a batch_alter_table block (same pattern used in other SQLite-compatible migrations in this codebase).
Labels: bug, triage
Description
The downgrade() function in migration 6c0e5f8a9b1d_add_gateway_lifecycle_fields.py uses individual op.drop_column() calls which fail on SQLite versions prior to 3.35.0 when not inside a batch_alter_table context.
Reproduction
On SQLite less than 3.35.0:
Expected behavior
downgrade -1 should succeed on SQLite by wrapping drop_column calls inside batch_alter_table.
Fix
Replace the per-column op.drop_column loop with a batch_alter_table block (same pattern used in other SQLite-compatible migrations in this codebase).
Labels: bug, triage