infra/sql/0011_portal_invites.sql
Metadata
- Purpose: SQL migration or seed data script for persistent storage.
- Domain:
infrastructure - Language:
sql - Bytes: 649
- Lines: 19
- Content hash (short):
2f534493 - Source (start): infra/sql/0011_portal_invites.sql:1
- Source (end): infra/sql/0011_portal_invites.sql:19
Indexed Symbols
No indexed functions/methods detected in this file.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
create table if not exists portal_invites (
id uuid primary key default gen_random_uuid(),
workspace_id uuid not null references workspaces(id) on delete cascade,
email text not null,
client_id uuid,
token_jti text not null unique,
token_subject text not null,
status text not null default 'active' check (status in ('active', 'revoked', 'expired')),
expires_at timestamptz not null,
created_by text not null,
created_at timestamptz not null default now(),
revoked_at timestamptz,
revoked_by text
);
create index if not exists idx_portal_invites_workspace_status
on portal_invites(workspace_id, status, created_at desc);