platform.user_invitations
Invitations issued by an org to an email.
Columns
| Column | Type | Notes |
|---|---|---|
id | UUID PK | |
org_id | UUID FK | → platform.organizations(id) ON DELETE CASCADE. |
invited_by | UUID FK | → platform.users(id) ON DELETE CASCADE. |
email | VARCHAR(320) | Target email. Not necessarily a users.email yet. |
role | org_role | NOT NULL. ENUM. Role to grant on acceptance. |
token | UUID | UNIQUE. Default gen_random_uuid(). |
expires_at | TIMESTAMPTZ | NOT NULL. Default NOW() + 7 days. |
accepted_at | TIMESTAMPTZ | NULL until accepted. |
revoked_at | TIMESTAMPTZ | NULL until revoked. |
created_at | TIMESTAMPTZ | NOT NULL. Default NOW(). |
Constraints:
CHECK (accepted_at IS NULL OR revoked_at IS NULL).- Partial UNIQUE
(org_id, email) WHERE accepted_at IS NULL AND revoked_at IS NULL.