From ecabd9cc0a8968ec8b16f969a3dde40cc597a793 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Fri, 3 Oct 2025 23:24:56 +0000 Subject: [PATCH] Prevent EVENTS.Behavior from changing --- db/schemas/lib/triggers/create/events.m4 | 7 +++++++ doc/src/tables/events.m4 | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/db/schemas/lib/triggers/create/events.m4 b/db/schemas/lib/triggers/create/events.m4 index e52c217..ed80fe1 100644 --- a/db/schemas/lib/triggers/create/events.m4 +++ b/db/schemas/lib/triggers/create/events.m4 @@ -38,6 +38,13 @@ CREATE OR REPLACE FUNCTION events_func () IF TG_OP = 'UPDATE' THEN -- Allowing the EID to change makes life too complicated. cannot_change(`EVENTS', `EID') + + -- If the Behavior is allowed to change, we need to add code here + -- that checks all the tables related to the participants and the + -- various event detail tables. This is way too much code; it is + -- easier to prevent the behavior from changing and instead + -- require the old rows be deleted and then new ones added. + cannot_change(`EVENTS', `Behavior') END IF; RETURN NULL; diff --git a/doc/src/tables/events.m4 b/doc/src/tables/events.m4 index c7494b9..e0b5da6 100644 --- a/doc/src/tables/events.m4 +++ b/doc/src/tables/events.m4 @@ -151,7 +151,7 @@ The following list summarizes the available codes: See :ref:`above ` for futher detail regarding what related data each code requires, or is expected to have. -|notnull| +|cannot_change| |notnull| .. _EVENTS.Start: -- 2.34.1