Case-insensitive UniqueConstraint using SQLAlchemy with PostgreSQL DB
I am using SQLAlchemy and PostgreSQL, and I am trying to create a case-insensitive unique constraint that works like this UniqueConstraint( 'country', 'organisation_id', func.lower(func.trim('name')), name='uq_country_orgid_lower_trim_name' ) Ensuring a unique combination of name, country and organisation id, regardless of case and…