New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto generate not working for postgres JSONB #411

Closed
sqlalchemy-bot opened this Issue Feb 16, 2017 · 6 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Feb 16, 2017

Migrated issue, originally created by Paul van der Linden

When I auto generate a migration for a model with a jsonb field i get the following error:

    sa.Column('data', postgresql.JSONB(astext_type=Text()), nullable=True),
NameError: name 'Text' is not defined

This is with version alembic 0.8.10 and sqlalchemy 1.1.5, it used to work, and would not add the astext_type=Text() (in version alembic 0.8.9 and sqlalchmey 1.0.15).

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 16, 2017

Michael Bayer (@zzzeek) wrote:

this is of the same class as #85 and the PR we have at zzzeek/alembic#38 would form the basis for the architecture that allows these various Postgresql "nested" types to render directly.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 22, 2017

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 22, 2017

Changes by Michael Bayer (@zzzeek):

  • set milestone to "fasttrack"
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 22, 2017

Changes by Michael Bayer (@zzzeek):

  • added labels: autogenerate - rendering
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 23, 2017

Michael Bayer (@zzzeek) wrote:

Apply subtype repr logic to JSON/JSONB

Fixed bug where Postgresql JSON/JSONB types rendered on SQLAlchemy
1.1 would render the "astext_type" argument which defaults to
the Text() type without the module prefix, similarly to the
issue with ARRAY fixed in 🎫85.

Also modifies the ARRAY approach from 🎫85 to be
regular expression based for safer targeting of the inner
repr() type.

Change-Id: I66d51301f4bf5b747b5e8da26a83cbff075d71b2
Fixes: #411

9fab143

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 23, 2017

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment