You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the revision script, resulting in sqlalchemy.exc.ConstraintColumnNotFoundError: Can't create ExcludeConstraint on table 'time_slot': no column named 'tstzrange(effective_time, expiry_time)' is present.
Adding sqlalchemy.text around the string does fix the issue
Expected behavior
the table definition works with sqlalchemy's Base.metadata.create_all(bind=engine), creating
"time_slot_tstzrange_excl" EXCLUDE USING gist (tstzrange(effective_time, expiry_time) WITH &&)
in the database so I expect it works the same in alembic
sqlalchemy.exc.ConstraintColumnNotFoundError: Can't create ExcludeConstraint on table 'time_slot': no column named 'tstzrange(effective_time, expiry_time)' is present.
Versions.
OS: macOS
Python: 3.11.3
Alembic: 1.10.4
SQLAlchemy: 2.0.11
Database: postgresql 15.2
DBAPI: psycopg 3.1.8
Additional context
This is the first time I work with ExcludeConstraint, so it might just be me using the wrong way to define it in the model
Have a nice day!
The text was updated successfully, but these errors were encountered:
Describe the bug
when running
alembic revision --autogenerate
, on a table withit generates
in the revision script, resulting in
sqlalchemy.exc.ConstraintColumnNotFoundError: Can't create ExcludeConstraint on table 'time_slot': no column named 'tstzrange(effective_time, expiry_time)' is present.
Adding
sqlalchemy.text
around the string does fix the issueExpected behavior
the table definition works with
sqlalchemy
'sBase.metadata.create_all(bind=engine)
, creatingin the database so I expect it works the same in alembic
To Reproduce
I setup a minimal example in this repo: https://github.com/tc-yu/alembic-pgsql-tztsrange
model:
Error
Versions.
Additional context
This is the first time I work with ExcludeConstraint, so it might just be me using the wrong way to define it in the model
Have a nice day!
The text was updated successfully, but these errors were encountered: