Will Alembic auto-detect changes in Python Enums? #1760
-
|
We have a column definition like this: architecture: Mapped[Optional[ReleaseArchitecture]] = mapped_column(Enum(ReleaseArchitecture, name="architecture_enum"))If we, in our code, change the members of |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
the situation with alembic and PostgreSQL enums is unfortunately at a zero level right now, meaning autogenerate doesn't consider PG enums at all and you need to do these ALTER options manually (there are also no alembic ALTER TYPE ops, so you need to use op.execute() for these). |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the reply. I did find https://github.com/Pogchamp-company/alembic-postgresql-enum and haven't yet tested it, but it may work for my purposes. |
Beta Was this translation helpful? Give feedback.
the situation with alembic and PostgreSQL enums is unfortunately at a zero level right now, meaning autogenerate doesn't consider PG enums at all and you need to do these ALTER options manually (there are also no alembic ALTER TYPE ops, so you need to use op.execute() for these).