From 4321b13cfe8d24bf033079b2b8c2ac3678ceeb1e Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 1 Oct 2025 21:21:32 +0000 Subject: [PATCH] The COMM_MEMBS.CommMID cannot change --- db/schemas/lib/triggers/create/comm_membs.m4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/db/schemas/lib/triggers/create/comm_membs.m4 b/db/schemas/lib/triggers/create/comm_membs.m4 index 625d91d..669b9ee 100644 --- a/db/schemas/lib/triggers/create/comm_membs.m4 +++ b/db/schemas/lib/triggers/create/comm_membs.m4 @@ -1,4 +1,5 @@ -dnl Copyright (C) 2023, 2024 The Meme Factory, Inc. http://www.karlpinc.com/ +dnl Copyright (C) 2023, 2024, 2015 The Meme Factory, Inc. +dnl http://www.karlpinc.com/ dnl dnl This program is free software: you can redistribute it and/or modify it dnl under the terms of the GNU Affero General Public License as published by @@ -32,9 +33,14 @@ CREATE OR REPLACE FUNCTION comm_membs_func () BEGIN -- Function for comm_membs insert and update triggers -- - -- AGPL_notice(` --', `2023, 2024', + -- AGPL_notice(` --', `2023, 2024, 2025', `The Meme Factory, Inc., www.karlpinc.com') + IF TG_OP = 'UPDATE' THEN + -- Allowing the CommMID to change makes life too complicated. + cannot_change(`COMM_MEMBS', `CommMID') + END IF; + -- An individual may not be recorded in more than one community on -- any given day. DECLARE -- 2.34.1