Files
buzz/migrations/0040_protected_domain_marker_guard.sql
Cea Stapleton Cordasco eedb356f3d feat(db): persist protected object authority
Canonical O4 slice: 04_protected_authority
Final-tree source: e45553ea65b66631771c16908513f983d3c0b881

Signed-off-by: Cea Stapleton Cordasco <261786559+cea-block@users.noreply.github.com>
2026-08-04 11:43:38 -05:00

17 lines
716 B
PL/PgSQL

-- Protected-domain activation is a one-way V1 cutover. Removing the marker
-- would disable database lifecycle fencing and let an unaware release treat
-- the domain as legacy. O4 has no witnessed downgrade operation, so direct
-- marker removal remains unavailable.
CREATE FUNCTION deny_protected_domain_marker_delete() RETURNS trigger
LANGUAGE plpgsql AS $$
BEGIN
RAISE EXCEPTION 'protected domain activation cannot be removed without a separately witnessed authority model'
USING ERRCODE = 'check_violation';
END
$$;
CREATE TRIGGER protected_domain_marker_delete_guard
BEFORE DELETE ON authorization_invalidation_domains
FOR EACH ROW EXECUTE FUNCTION deny_protected_domain_marker_delete();