Skip to content

[BUG]: Migration 6c0e5f8a9b1d downgrade fails on SQLite (DROP COLUMN requires batch mode) #5873

Description

@jonpspri

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssues / Features awaiting triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions