Re: Using enums with schema_translate_map

2020-02-17 Thread Brian Hill
Thanks for figuring this out. On Monday, February 17, 2020 at 3:05:30 PM UTC-5, Mike Bayer wrote: > > Here is your SQL output, enum is created correctly: > > CREATE TYPE test_schema.enum1 AS ENUM ('One', 'Two') > > > however table does not refer to the correct enum: > > CREATE TABLE

Re: Using enums with schema_translate_map

2020-02-17 Thread Mike Bayer
Here is your SQL output, enum is created correctly: CREATE TYPE test_schema.enum1 AS ENUM ('One', 'Two') however table does not refer to the correct enum: CREATE TABLE test_schema.table1 ( id SERIAL NOT NULL, type1 enum1, PRIMARY KEY (id) ) this is SQLAlchemy bug

Re: Using enums with schema_translate_map

2020-02-17 Thread Mike Bayer
mm nope we have plenty of tests for this here: https://github.com/sqlalchemy/sqlalchemy/blob/master/test/dialect/postgresql/test_compiler.py#L223 On Mon, Feb 17, 2020, at 2:49 PM, Mike Bayer wrote: > it's possible also that PG Enum CREATE TYPE doesn't work with > schema_translate_map, would

Re: Using enums with schema_translate_map

2020-02-17 Thread Mike Bayer
it's possible also that PG Enum CREATE TYPE doesn't work with schema_translate_map, would need to evaluate that on the SQLAlchemy side. On Mon, Feb 17, 2020, at 2:45 PM, Mike Bayer wrote: > schema_translate_map is not yet supported with all Alembic ops: > >

Re: Using enums with schema_translate_map

2020-02-17 Thread Mike Bayer
schema_translate_map is not yet supported with all Alembic ops: https://github.com/sqlalchemy/alembic/issues/555 you will need to fill in the "schema" parameter explicitly when you call upon op.create_table() On Mon, Feb 17, 2020, at 12:47 PM, Brian Hill wrote: > I'm having trouble using

Using enums with schema_translate_map

2020-02-17 Thread Brian Hill
I'm having trouble using enums in conjunction with schema_translate_map for postgres migrations. My model, single table, single enum. import enum from sqlalchemy import MetaData, Enum, Column, Integer from sqlalchemy.ext.declarative import declarative_base metadata = MetaData() Base =