sqlalchemy / sqlalchemy/alembic
Migration downgrade doesn't drop type created by Enum
Open
Nobody has claimed this yet.
autogenerate for enums
bug
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 375
- PR merge metrics
- No merged PRs in 30d
Description
Given a model definition with an Enum, the resulting autogenerated migration creates a type in the database (Postgresql).
The relative downgrade migration doesn't drop it from the database, making it impossible to perform an upgrade (since this type is already existing).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the autogenerated migration from a model containing a PostgreSQL Enum, then inspect the generated upgrade and downgrade operations. The downgrade should remove the database type so a subsequent upgrade can recreate it; add regression coverage for that sequence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python, sqlalchemy
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100