--- id: alembic-postgresql-enum version: "1.10.0" license: MIT license_treatment: permissive maintenance: active --- # alembic-postgresql-enum — Alembic autogenerate support for creation, alteration and deletion of enums License: permissive · Maintenance: active · Downloads: 2.9M/mo ## What it is and what it does This package hooks into Alembic's autogenerate process to detect when enums are created, modified, or removed from your SQLAlchemy models, then generates migration code to keep your PostgreSQL schema in sync. When you import the package in your migrations/env.py file, it registers custom comparators that watch for enum changes. If you add a new enum column to a model, Alembic will generate migration code that creates the enum type in PostgreSQL before creating the column. If you remove an enum column, the migration will drop the unused enum. If enum values change, the migration generates sync operations to update the type definition. The package automates enum creation, removal, addition and deletion of enum values, reordering of enum values, and deletion of unused enums from schema. Enum value renaming requires manual migration editing. Use it for: - Automatically generate migrations when adding a new PostgreSQL enum column to an existing table - Track and apply enum value additions or deletions across your codebase without manual SQL - Clean up unused enum types from PostgreSQL when they are removed from your models - Maintain consistency between SQLAlchemy enum definitions and the PostgreSQL schema during team development - Avoid manual enum creation and deletion SQL in migration files by letting autogenerate handle it ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extends Alembic to automatically detect and manage PostgreSQL enum types during schema migrations, handling creation, modification, and deletion of enums and their values. Yes. If you use Alembic with PostgreSQL enums, this package eliminates a significant manual step in migration generation. It has no known vulnerabilities, low install friction, active maintenance, and permissive MIT licensing. The only limitation is that enum value renames require manual migration editing. ## Install pip install alembic-postgresql-enum uv add alembic-postgresql-enum poetry add alembic-postgresql-enum ## Installing alembic-postgresql-enum Before you install: Low friction install with only 2 runtime dependencies (alembic and sqlalchemy). Repository is active with recent commits and no known vulnerabilities. Supports Python 3.7 through 3.14. License in practice: MIT license is permissive and places no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: pip install alembic-postgresql-enum # In migrations/env.py, add at the top: import alembic_postgresql_enum # Then run: alembic revision --autogenerate Requires an existing Alembic project with SQLAlchemy models using postgresql.ENUM columns; PostgreSQL database backend. Verify before relying: - Whether enum value renaming truly requires manual migration editing or if there are workarounds - Performance characteristics with large numbers of enums or enum values - Compatibility with PostgreSQL versions older than the current release cycle ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags alembic postgresql enum migration, auto-generate enum migrations, postgresql enum schema changes, alembic enum autogenerate, database enum version control, postgresql type management alembic, postgresql, schema-migration, orm [View on SkillFed](https://skillfed.io/packages/alembic-postgresql-enum) · [View on PyPI](https://pypi.org/project/alembic-postgresql-enum/)