Re: Migrating PEP-435 Enums

2018-09-24 Thread Alex Rothberg
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

Re: Migrating PEP-435 Enums

2018-09-24 Thread Alex Rothberg
es have an ENUM type.Your request for an > "op.alter_column()" directive is basically asking for those issues to > be done. I'm on a long term search for code contributors who can > work on that stuff, ENUM is going to be very hard to work front to > back in all cases

Re: Migrating PEP-435 Enums

2018-09-24 Thread Alex Rothberg
ntirely 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 &g

Migrating PEP-435 Enums

2018-09-24 Thread Alex Rothberg
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