From b6d8e3d6ae3cecc055e49777291895341bcc0416 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Fri, 3 Oct 2025 23:25:57 +0000 Subject: [PATCH] Prevent ROLES.EID from changing --- db/schemas/lib/triggers/create/roles.m4 | 6 ++++++ doc/src/tables/roles.m4 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/db/schemas/lib/triggers/create/roles.m4 b/db/schemas/lib/triggers/create/roles.m4 index f49e96b..b248c72 100644 --- a/db/schemas/lib/triggers/create/roles.m4 +++ b/db/schemas/lib/triggers/create/roles.m4 @@ -38,6 +38,12 @@ CREATE OR REPLACE FUNCTION roles_func () IF TG_OP = 'UPDATE' THEN -- Allowing the PID to change makes life too complicated. cannot_change(`ROLES', `PID') + + -- Allowing the EID to change means that UPDATEs have to check + -- the old event to be sure that its rule requirements are satisfied. + -- This is too much work; easier to require the role be deleted + -- and a new one created. + cannot_change(`ROLES', `EID') END IF; RETURN NULL; diff --git a/doc/src/tables/roles.m4 b/doc/src/tables/roles.m4 index 64cc284..5f19f68 100644 --- a/doc/src/tables/roles.m4 +++ b/doc/src/tables/roles.m4 @@ -62,7 +62,7 @@ EID (Event ID) |ROLES.Participant| played a role. -|ROLES.EID_summary| |notnull| +|ROLES.EID_summary| |cannot_change| |notnull| .. _ROLES.Role: -- 2.34.1