At most one pending offer per (to_account, role, scope_kind, scope, from_actor).
Including from_actor_id in the tuple lets multiple grantors coexist —
teacher A and teacher B can each have a pending classroom_student offer
for the same student and scope. A same-grantor re-offer upserts the
existing pending row. COALESCE collapses NULL scopes into the
sentinel values so Postgres's NULL-in-unique-index quirk does not allow
duplicate global pending offers; the scope_kind / scope_id pair is
always either both null (global) or both non-null (scoped) per the
role_grant_offer_scope_kind_paired CHECK, so the two COALESCE expressions
always agree. The ON CONFLICT target in query_role_grant_offer_create must
match this expression literally.