196b543bee
CI / build-and-test (push) Successful in 1m47s
* Implement tenant and user creation in IdentityPage * Add API calls for managing tenants and users * Introduce tenant-scoped API requests * Update sidebar to include identity navigation * Create BooleanStatusBadge component for key status
34 lines
920 B
Plaintext
34 lines
920 B
Plaintext
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]
|
|
}
|