Files
archie/internal/platform/pg/migrations/00018_enterprise_oidc.sql
T

24 lines
968 B
SQL

-- +goose Up
ALTER TABLE governance.authentication_settings
ADD COLUMN oidc_client_secret_sealed bytea NOT NULL DEFAULT '\x'::bytea,
ADD COLUMN oidc_groups_claim text NOT NULL DEFAULT '',
ADD COLUMN oidc_role_map jsonb NOT NULL DEFAULT '{}',
ADD COLUMN sso_only boolean NOT NULL DEFAULT false,
ADD COLUMN session_idle_timeout_s integer NOT NULL DEFAULT 0 CHECK (session_idle_timeout_s >= 0),
ADD COLUMN session_max_lifetime_s integer NOT NULL DEFAULT 0 CHECK (session_max_lifetime_s >= 0);
ALTER TABLE governance.account_sessions
ADD COLUMN last_seen_at timestamptz NOT NULL DEFAULT now();
-- +goose Down
ALTER TABLE governance.account_sessions
DROP COLUMN last_seen_at;
ALTER TABLE governance.authentication_settings
DROP COLUMN session_max_lifetime_s,
DROP COLUMN session_idle_timeout_s,
DROP COLUMN sso_only,
DROP COLUMN oidc_role_map,
DROP COLUMN oidc_groups_claim,
DROP COLUMN oidc_client_secret_sealed;