--- id: alembic-autogenerate-enums version: "0.1.2" license: MIT license_treatment: permissive maintenance: abandoned --- # alembic-autogenerate-enums — Alembic hook that allows enums values to be upgraded and downgraded in migrations automatically License: permissive · Maintenance: abandoned · Downloads: 155.7K/mo ## 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 above — 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 pip install alembic-autogenerate-enums uv add alembic-autogenerate-enums poetry add alembic-autogenerate-enums ## Installing 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_current - Install friction: low - Maintenance: abandoned - Downloads: 155.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags alembic enum migration, postgresql enum autogenerate, alembic alter type add value, enum schema migration, alembic postgres enum changes, alembic, postgresql, schema-migration [View on SkillFed](https://skillfed.io/packages/alembic-autogenerate-enums) · [View on PyPI](https://pypi.org/project/alembic-autogenerate-enums/)