This seems to work / provide a good template of how to get that
info: https://github.com/dw/alembic-autogenerate-enums
On Monday, September 24, 2018 at 5:19:39 PM UTC-4, Alex Rothberg wrote:
>
> and is there an easy way to progrmatically get the name of the enum from
> the model field (given I d
and is there an easy way to progrmatically get the name of the enum from
the model field (given I declared it as as above)?
On Monday, September 24, 2018 at 5:16:44 PM UTC-4, Mike Bayer wrote:
>
> you don't gain much since it only works on Postgresql anyway.Also,
> the syntax you suggested w
you don't gain much since it only works on Postgresql anyway.Also,
the syntax you suggested wouldn't work, because Postgresql needs to
know the name of the enumeration.
This is part of why all the "enum" issues for alembic are just open.
The way PG does it vs. MySQL are immensely different,
is there no way to get this alter statement without writing raw sql?
e.g. something like: op.alter_column("my_table", "my_column",
existing_type=ENUM(...), type_=ENUM()) ?
On Monday, September 24, 2018 at 2:36:52 PM UTC-4, Mike Bayer wrote:
>
> Postgresql ENUMs are entirely different from any oth
Postgresql ENUMs are entirely different from any other database so it
matters a lot. For PG, you'd want to be doing op.execute("ALTER TYPE
myenum ..."), full syntax is at
https://www.postgresql.org/docs/9.1/static/sql-altertype.html
On Mon, Sep 24, 2018 at 12:45 PM Alex Rothberg wrote:
>
> Assumi
Assuming that I am using the PEP-435 enum feature in SQLA, e.g.:
class InvitationReason(str, enum.Enum):
ORIGINAL_ADMIN = "ORIGINAL_ADMIN"
FIRM_USER = "FIRM_USER"
...
reason = db.Column(db.Enum(InvitationReason), nullable=False)
and I want to add / change the values in the enum. I kno