Skip to content
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 · 9 comments
Closed

auto generate not working for postgres JSONB #411

sqlalchemy-bot opened this issue Feb 16, 2017 · 9 comments

Comments

@sqlalchemy-bot
Copy link

@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
Copy link
Author

@sqlalchemy-bot 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
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Feb 22, 2017

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Feb 22, 2017

Changes by Michael Bayer (@zzzeek):

  • set milestone to "fasttrack"
@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Feb 22, 2017

Changes by Michael Bayer (@zzzeek):

  • added labels: autogenerate - rendering
@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot 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
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Feb 23, 2017

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
@joanna350
Copy link

@joanna350 joanna350 commented Jan 28, 2019

I cannot get this to work. How are these cases 'closed' when there is no apparent solution??? https://gerrit.sqlalchemy.org/313 -> did not give me any lead, some other sites have these threads that are not trackable, if a bug within Alembic, why is the solution not clear for all's view?

@mikeywaites
Copy link
Contributor

@mikeywaites mikeywaites commented Jan 28, 2019

Hey @joanna350 sorry you're still having trouble.

So that I can properly replicate the issue could you provide me with a simple test case, version of postgresql you're running, versions of alembic and sqlalchemy and anything else you think would be helpful.

@joanna350
Copy link

@joanna350 joanna350 commented Jan 28, 2019

I really appreciate this response..and look forward to hearing back in the other thread, or other links that may help. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants