MIG001errorPro

alembic-revision-id-too-long

Alembic revision identifier exceeds the 32-character limit of the default alembic_version.version_num column

Applies to: Python

Why this matters

alembic_version.version_num is VARCHAR(32) by default. A revision id over 32 characters works in local SQLite (no length enforcement) and then fails the UPDATE on Postgres/MySQL — production can never record the migration as applied, and every subsequent migration stops running. If the deploy script also suppresses migration exit codes, the failure is completely silent: the schema quietly stops evolving.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, MIG001 includedstablestack explain MIG001

MIG001 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: MIG001