Skip to main content

infra/sql/0007_configuration_plane.sql

Metadata

Indexed Symbols

No indexed functions/methods detected in this file.

Markdown Headings (if applicable)

No markdown headings detected.

Source Preview

-- Runtime configuration and secret storage for SaaS-style control plane.

create table if not exists platform_settings (
setting_key text primary key,
value jsonb not null,
version integer not null default 1,
updated_by text not null,
updated_at timestamptz not null default now()
);

create table if not exists workspace_settings (
workspace_id uuid primary key references workspaces(id) on delete cascade,
value jsonb not null,
version integer not null default 1,
updated_by text not null,
updated_at timestamptz not null default now()
);

create table if not exists runtime_secrets (
scope_type text not null check (scope_type in ('platform', 'workspace')),
scope_id uuid not null,
secret_key text not null,
ciphertext jsonb not null,
created_by text not null,
updated_by text not null,