alembic-autogenerate-enums
Alembic hook that allows enums values to be upgraded and downgraded in migrations automatically
What it is and what it does
This package hooks into Alembic's autogenerate mechanism to automatically detect when PostgreSQL enum types have new values added to your models, then generates the corresponding ALTER TYPE .. ADD VALUE SQL statements in your migration files. Without this hook, Alembic's default autogenerate ignores enum value changes, requiring manual migration writing.
The package works by registering itself when imported into your env.py file. It handles a PostgreSQL constraint: ALTER TYPE statements cannot run inside transactions, so each enum sync operation opens its own temporary database connection. This is a thin, specialized tool for teams using Alembic with PostgreSQL enums who want migrations to stay in sync with model changes automatically.
Use it for:
- Automatically generate migrations when adding new values to existing PostgreSQL enum types in your SQLAlchemy models.
- Avoid manual ALTER TYPE SQL writing by letting Alembic detect enum changes during autogenerate.
- Ensure enum migrations are tracked in version control alongside other schema changes in a PostgreSQL project.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extends Alembic's autogenerate to detect and emit PostgreSQL enum value changes as ALTER TYPE ADD VALUE statements in migrations.
No, not recommended. The package is abandoned with no updates in over a year and has no documented compatibility with current Alembic or PostgreSQL versions. For active projects, the maintenance risk outweighs the convenience of enum autogeneration. Consider manual enum migrations or evaluating whether a maintained alternative exists before adopting this.
Install
alembic-autogenerate-enums on PyPI
pip
pip install alembic-autogenerate-enumsuv
uv add alembic-autogenerate-enumspoetry
poetry add alembic-autogenerate-enumsInstalling alembic-autogenerate-enums
Before you install
Low install friction with no runtime dependencies. However, the package is abandoned—last release was 1122 days ago with no recent maintenance signal, which raises questions about compatibility with current Alembic and PostgreSQL versions.
License in practice
MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text.
Quickstart
# In your alembic/env.py, add at the top:
import alembic_autogenerate_enums
# Then run migrations normally:
# alembic revision --autogenerate -m "Add enum values"
# alembic upgrade head
Requires PostgreSQL database and an existing Alembic project; the package assumes you are already using Alembic for schema management.
Verify before relying
- Compatibility with current Alembic versions and PostgreSQL enum handling behavior
- Whether the non-transactional connection workaround still aligns with modern Alembic patterns
- Test coverage and real-world usage reliability given the abandoned maintenance status
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,122 days since the last release |
| First released | |
| Downloads | 155,677/month — #10,804 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: alembic_autogenerate_enums-0.1.2-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
alembic-postgresql-enumExtends Alembic to automatically detect and…
permissive · top 5,000 on PyPI
alembic_utilsExtends Alembic to autogenerate database…
permissive · top 5,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
Flask-AlembicFlask-Alembic integrates Alembic database…
permissive · top 15,000 on PyPI
pytest-alembicA pytest plugin that runs built-in and custom…
permissive · top 5,000 on PyPI
migramigra compares PostgreSQL database schemas and…
permissive · top 15,000 on PyPI
Flask-MigrateFlask-Migrate handles SQLAlchemy database…
permissive · top 5,000 on PyPI
django-pg-zero-downtime-migrationsProvides a Django database backend for…
permissive · top 15,000 on PyPI
django-postgres-extraExtends Django's ORM to expose…
permissive · top 15,000 on PyPI
pglastParses PostgreSQL SQL statements into an…
copyleft · top 5,000 on PyPI