Unique Index/Constraint allow duplicates ONLY when ALL references are null

xecute( "create unique index INDEX_NAME on TABLE
  (
    coalesce(parent_organization_id, ''),
    coalesce(organization_id, ''),
    coalesce(cohort_id, ''),
    coalesce(team_id, '')
  ) where individual == false
")

This marks what is called a “partial index” where the index only applies to the rows where the condition is true.