Table tenants { id text [pk] name text [not null, unique] created_at timestamptz [not null, default: `now()`] } Table tenant_users { id text [pk] tenant_id text [not null, ref: > tenants.id] name text [not null] email text created_at timestamptz [not null, default: `now()`] Indexes { tenant_id (tenant_id, email) [unique] } } Table api_key_assignments { key_id text [pk] tenant_id text [not null, ref: > tenants.id] user_id text [ref: > tenant_users.id] description text [not null, default: ''] source text [not null] enabled boolean [not null, default: true] created_at timestamptz [not null, default: `now()`] } Table managed_api_keys { key_id text [pk, ref: > api_key_assignments.key_id] secret_hash text [not null] }