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
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
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
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:
>
>
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
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 =