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

Flask Migration Issue #43

Closed
zzachattack2 opened this issue Nov 9, 2019 · 2 comments
Closed

Flask Migration Issue #43

zzachattack2 opened this issue Nov 9, 2019 · 2 comments

Comments

@zzachattack2
Copy link

I've been having issue installing within flask with the following error:

File "/.local/share/virtualenvs/backend-Xo4Co4k2/lib/python3.7/site-packages/sqlalchemy/util/_collections.py", line 194, in __getitem__ return self._data[key] KeyError: "tsrange(issued_at - INTERVAL '1 hour', issued_at)"

Seems to be based on the following from the alembic migration script:
postgresql.ExcludeConstraint((sa.column('native_transaction_id'), '='), ("tsrange(issued_at - INTERVAL '1 hour', issued_at)", '&&'), using='gist', name='transaction_unique_native_tx_id')

Tested on both postgres 10 and 11. Any suggestions?

@wakemaster39
Copy link

Through many hours of digging on this exact same issue, I believe the problem is the raw text and it not being sql. wrapping the text in text treats it as sql and it then proceeded to work.

postgresql.ExcludeConstraint((sa.column('native_transaction_id'), '='), (text("tsrange(issued_at - INTERVAL '1 hour', issued_at)"), '&&'), using='gist', name='transaction_unique_native_tx_id'),

I still have some more testing to do to make sure it works. I am also not sure if this is a recommended approach to fixing the issue.

@thapakaazzi
Copy link

any progress on this issue???

@zzachattack2 zzachattack2 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants