Files
archie/internal/platform/pg/migrations/00027_judgement_policies.sql
T

17 lines
576 B
SQL

-- +goose Up
-- Hard rules and change-request rules are Cedar policy sets, one per kind per
-- organisation. Every version is kept; the highest is the one in force.
CREATE TABLE judgement.policy_sets (
id uuid PRIMARY KEY,
org_id text NOT NULL,
kind text NOT NULL CHECK (kind IN ('hard_rules', 'change_request')),
version integer NOT NULL,
body text NOT NULL,
created_by text NOT NULL,
created_at timestamptz NOT NULL DEFAULT now(),
UNIQUE (org_id, kind, version)
);
-- +goose Down
DROP TABLE judgement.policy_sets;