Bug: Alembic migration chain stuck — 020 applied but not stamped, app down #184
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api#184
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Bug
Lineage
Discovered during westside deploy session. App is down — pod crash-loops on migration 020 (column already exists).
Repo
forgejo_admin/basketball-apiWhat Broke
Alembic migration 020 (custom_notes column) was applied to the database but the alembic_version table was never stamped past 018. After the chain was linearized to 018→019→020→..., alembic tries to run 020 again and fails because the column already exists.
Migration state:
Repro Steps
Expected Behavior
Migration 020 should be idempotent — check if column exists before adding. Or: alembic should be stamped to 020 to skip the already-applied migration.
Environment
Acceptance Criteria
Test Expectations
pytest tests/passes (existing 555 tests)pytest tests/ -xConstraints
Checklist
Related
project-westside-basketballScope Review: READY
Review note:
review-449-2026-03-26Scope is solid. All bug template sections present, file targets verified (020 confirmed non-idempotent add_column), migration chain 018-023 validated, no blocking dependencies. Acceptance criteria are agent-verifiable.