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

model level booleans coming through autogen should at least be complete #58

Closed
sqlalchemy-bot opened this Issue Jul 8, 2012 · 5 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Jul 8, 2012

Migrated issue, originally created by Anonymous

When I make new revision with --autogenerate options for new boolean column I get this migration script

#!python
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
...
    sa.Column('is_grand', sa.Boolean(), nullable=True),
    sa.CheckConstraint('TODO'),
...

The script is running with error:

sqlalchemy.exc.ProgrammingError: (ProgrammingError) column "todo" does not exist

What does it mean TODO?
Does alembic support sqlachemy boolean type?

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jul 8, 2012

Michael Bayer (@zzzeek) wrote:

it means that autogenerate does not render the SQL text of a CheckConstraint just yet. A Boolean may have a CheckConstraint associated with it, if the backend only supports integers. I'm not sure why in your case it is actually spitting the constraint out, though, it should be implicit with the Boolean type, since some backends shouldn't be getting the constraint.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jul 8, 2012

Changes by Michael Bayer (@zzzeek):

  • changed title from "Does alembic sqlachemy boolean type support?" to "model level booleans coming through autogen should"
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jul 8, 2012

Anonymous wrote:

Yes, I thought so about.

Thanks for the quick reply.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jul 8, 2012

Michael Bayer (@zzzeek) wrote:

this is fixed regarding unnecessary gen of the CheckConstraint associated with Boolean, and also the SQL text of CheckConstraint is rendered for those constraints that are actually present explicitly. [[https://bitbucket.org/zzzeek/alembic/changeset/f579cfeda37763bfe93268a20b534f2f79b4a0dc|f579cfeda37763bfe93268a20b534f2f79b4a0dc]]

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jul 8, 2012

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