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

ExcludeConstraint breaks autogenerate #412

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

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Feb 16, 2017

Migrated issue, originally created by dataradiant (@dataradiant)

Using ExcludeConstraint() seems to break alembic's autogenerate.

I'm specifying the constraint in my __table_args__ as:
ExcludeConstraint(("destination_id", "="), ("route_id", "="), ("timerange","&&"), name="uq_msgtime", using="gist")

The error is ValueError: no dispatch function for object: ExcludeConstraint(). https://bitbucket.org/zzzeek/alembic/src/377198f274edad3220a9485c30827251f848fdac/alembic/util/langhelpers.py?at=master&fileviewer=file-view-default#langhelpers.py-300

It seems that the _registry attribute of the Dispatcher object doesn't contain the required tuple, specifically one that has any of the classes in the ExcludeConstraint mro.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 16, 2017

Changes by dataradiant (@dataradiant):

  • edited description
1 similar comment
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 16, 2017

Changes by dataradiant (@dataradiant):

  • edited description
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 17, 2017

Michael Bayer (@zzzeek) wrote:

so yes that should at the very least degrade gracefully as it does for other things that are non-detectable, then the PG impl can also deliver an implementation for this. that this blocks autogenerate makes it more urgent but I don't have time to get to it until next week, hope this is not blocking you.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 17, 2017

Changes by Michael Bayer (@zzzeek):

  • set milestone to "fasttrack"
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 20, 2017

Michael Bayer (@zzzeek) wrote:

this is on render, not compare.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 22, 2017

Michael Bayer (@zzzeek) wrote:

Add ExcludeConstraint support for Postgresql

Add full support for Postgresql add_exclude_constraint().
This opens up more of the operations API and serves as a
model for other dialect-specific constraints.

Additionally, gracefully degrade if a given constraint
class is not supported with a warning.

Fixes: #412
Change-Id: I0fb89c840518aaeae97929919356f944479bc756

01db038

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 22, 2017

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 23, 2017

Michael Bayer (@zzzeek) wrote:

Issue #386 was marked as a duplicate of this issue.

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