Closed
Description
Migrated issue, originally created by jahs (@jahs)
Hi, just a little import bug. The model (JSON column given for comparison purposes):
from sqlalchemy.dialects import postgresql as pg
t = sa.Table('spam', target_metadata,
sa.Column('eggs', pg.JSON),
sa.Column('ham', pg.HSTORE))
produces:
op.create_table('spam',
sa.Column('eggs', postgresql.JSON(astext_type=sa.Text()), nullable=True),
sa.Column('ham', postgresql.HSTORE(text_type=Text()), nullable=True)
)
which when run gives a traceback terminating with:
sa.Column('ham', postgresql.HSTORE(text_type=Text()), nullable=True)
NameError: name 'Text' is not defined
simply changing to Text()
to sa.Text()
as per JSON fixes it.
Using alembic==0.9.8.dev0, SQLAlchemy==1.2.1, psycopg2==2.7.3.2.
Thanks.