Re: File logger fails when used with a Gunicorn/Pyramid .ini file.

2018-09-24 Thread Mike Bayer
On Sun, Sep 23, 2018 at 9:53 PM wrote: > > Hello, > > In my project.ini file I have configured logging to use a file logger as > follows: > > [loggers] > keys = root, …, alembic > > [handlers] > keys = console, file > > [formatters] > keys = generic > > [logger_root] > level = INFO > handlers = c

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

Re: Migrating PEP-435 Enums

2018-09-24 Thread Mike Bayer
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

Re: Migrating PEP-435 Enums

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

Re: Migrating PEP-435 Enums

2018-09-24 Thread Mike Bayer
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,

Re: Migrating PEP-435 Enums

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

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 (given I d