From 1c389cea19d07c3102e4c5911a944c2fe7254516 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Fri, 3 Jul 2026 16:25:55 +0000 Subject: [PATCH] Use user-facing capitalization of AnimID everywhere --- db/schemas/lib/triggers/create/arrivals.m4 | 12 +++---- .../lib/triggers/create/biography_data.m4 | 32 +++++++++---------- db/schemas/lib/triggers/create/events.m4 | 2 +- db/schemas/lib/triggers/create/watches.m4 | 8 ++--- doc/src/code_tables.m4 | 4 +-- doc/src/tables/biography_data.m4 | 4 +-- doc/src/views.m4 | 2 +- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/db/schemas/lib/triggers/create/arrivals.m4 b/db/schemas/lib/triggers/create/arrivals.m4 index aadb179..27c494e 100644 --- a/db/schemas/lib/triggers/create/arrivals.m4 +++ b/db/schemas/lib/triggers/create/arrivals.m4 @@ -390,7 +390,7 @@ CREATE OR REPLACE FUNCTION arrivals_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_animid || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex @@ -442,7 +442,7 @@ CREATE OR REPLACE FUNCTION arrivals_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_animid || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex @@ -490,7 +490,7 @@ CREATE OR REPLACE FUNCTION arrivals_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_animid || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex @@ -541,7 +541,7 @@ CREATE OR REPLACE FUNCTION arrivals_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_animid || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex @@ -587,7 +587,7 @@ CREATE OR REPLACE FUNCTION arrivals_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_animid || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex @@ -632,7 +632,7 @@ CREATE OR REPLACE FUNCTION arrivals_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_animid || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex diff --git a/db/schemas/lib/triggers/create/biography_data.m4 b/db/schemas/lib/triggers/create/biography_data.m4 index 138037e..ac729bd 100644 --- a/db/schemas/lib/triggers/create/biography_data.m4 +++ b/db/schemas/lib/triggers/create/biography_data.m4 @@ -458,7 +458,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () , DETAIL = 'An individual cannot be watched -- be followed,' || ' or have an attendance record, etc. -- before' || ' they are under study' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '), Value (EntryDate) = (' || NEW.entrydate @@ -488,7 +488,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () , DETAIL = 'An individual cannot be watched -- be followed,' || ' or have an attendance record, etc. -- after' || ' they are no longer under study' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '), Value (DepartDate) = (' || NEW.departdate @@ -530,7 +530,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () MESSAGE = 'Error on UPDATE of BIOGRAPHY_DATA' , DETAIL = 'An individual cannot have records of sexual swelling' || ' unless they are female' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '), Value (Sex) = (' || NEW.sex @@ -562,7 +562,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () MESSAGE = 'Error on UPDATE of BIOGRAPHY_DATA' , DETAIL = 'An individual cannot have records of sexual swelling' || ' before they are under study' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '), Value (EntryDate) = (' || NEW.entrydate @@ -591,7 +591,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () MESSAGE = 'Error on UPDATE of BIOGRAPHY_DATA' , DETAIL = 'An individual cannot have records of sexual swelling' || ' after they are no longer under study' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '), Value (EntryDate) = (' || NEW.entrydate @@ -641,7 +641,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () MESSAGE = 'Error on UPDATE of BIOGRAPHY_DATA' , DETAIL = 'An individual cannot have records of reproductive' || ' state unless they are female' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '), Value (Sex) = (' || NEW.sex @@ -682,7 +682,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () MESSAGE = 'Error on UPDATE of BIOGRAPHY_DATA' , DETAIL = 'An individual cannot have records of reproductive' || ' state after they are no longer under study' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '), Value (EntryDate) = (' || NEW.entrydate @@ -750,7 +750,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () || ' ROLES.Participant) before' || ' their entry to the study' || ' (before BIOGRAPHY_DATA.EntryDate)' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (EntryDate) = (' || NEW.entrydate @@ -803,7 +803,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () || ' ROLES.Participant) after' || ' their departure from the study' || ' (before BIOGRAPHY_DATA.EntryDate)' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (DepartDate) = (' || NEW.departdate @@ -860,7 +860,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () , DETAIL = 'Invalid Sex; in mating events, the ROLES.Role' || ' of (sdb_actor) must be male and the' || ' ROLES.Role of (sdb_actee) must be female' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (Sex) = (' || NEW.Sex @@ -939,7 +939,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () , DETAIL = 'A female cannot be assigned the' || ' (sdb_male_swelling) code as a sexual cycle' || ' state' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (Sex) = (' || NEW.sex @@ -1014,7 +1014,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () || ' assigned the' || ' (sdb_adolescent_swelling) code as a sexual' || ' cycle state' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (Sex) = (' || NEW.sex @@ -1082,7 +1082,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () || ' assigned the' || ' (sdb_adolescent_swelling) code as a sexual' || ' cycle state' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (Sex) = (' || NEW.sex @@ -1154,7 +1154,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () || ' sdb_min_swelling_age_units old, cannot be' || ' assigned a cycle code that indicates' || ' sexual swelling' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (Sex) = (' || NEW.sex @@ -1222,7 +1222,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () || ' sdb_max_swelling_age_units old, cannot be' || ' assigned a cycle code that indicates' || ' sexual swelling' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (Sex) = (' || NEW.sex @@ -1286,7 +1286,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () , DETAIL = 'A non-female can only be assigned the' || ' (sdb_male_swelling) code as a sexual' || ' cycle state' - || ': Key (Animid) = (' + || ': Key (AnimID) = (' || NEW.animid || '): Value (Sex) = (' || NEW.sex diff --git a/db/schemas/lib/triggers/create/events.m4 b/db/schemas/lib/triggers/create/events.m4 index 1e2a8fd..e03b201 100644 --- a/db/schemas/lib/triggers/create/events.m4 +++ b/db/schemas/lib/triggers/create/events.m4 @@ -43,7 +43,7 @@ CREATE OR REPLACE FUNCTION events_func () -- If the WID is allowed to change, at minimum -- there may be other -- cases, the check that ROLES.Participant must be under study -- becomes complicated. It would require code in the triggers - -- to trace the BIOGRAPHY_DATA.Animid <- ROLES.Participant -> + -- to trace the BIOGRAPHY_DATA.AnimID <- ROLES.Participant -> -- EVENTS.EID --> WATCHES.WID chain to check WATCHES.Date -- against biography. Simpler to dis-allow change. cannot_change(`EVENTS', `WID') diff --git a/db/schemas/lib/triggers/create/watches.m4 b/db/schemas/lib/triggers/create/watches.m4 index ec9a64d..2fb5e2b 100644 --- a/db/schemas/lib/triggers/create/watches.m4 +++ b/db/schemas/lib/triggers/create/watches.m4 @@ -287,7 +287,7 @@ CREATE OR REPLACE FUNCTION watches_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_participant || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex @@ -358,7 +358,7 @@ CREATE OR REPLACE FUNCTION watches_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_participant || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex @@ -434,7 +434,7 @@ CREATE OR REPLACE FUNCTION watches_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_participant || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex @@ -511,7 +511,7 @@ CREATE OR REPLACE FUNCTION watches_func () || a_pid || '), Value (ROLES.Role) = (' || a_role - || ': Key (BIOGRAPHY_DATA.Animid) = (' + || ': Key (BIOGRAPHY_DATA.AnimID) = (' || a_participant || '): Value (BIOGRAPHY_DATA.Sex) = (' || a_sex diff --git a/doc/src/code_tables.m4 b/doc/src/code_tables.m4 index 536ad73..dbee3b6 100644 --- a/doc/src/code_tables.m4 +++ b/doc/src/code_tables.m4 @@ -354,7 +354,7 @@ Special Values not more than sdb_max_adolescent_age sdb_max_adolescent_age_units old. The exception to this rule are the unknown females, those with a - |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.Animid| that is one of: + |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.AnimID| that is one of: ``sdb_stranger_female``, ``sdb_stranger_female2``, and ``sdb_stranger_female3``. @@ -364,7 +364,7 @@ Special Values sdb_min_swelling_age sdb_min_swelling_age_units old, and not more than sdb_max_swelling_age sdb_max_swelling_age_units old. The exception to this rule are the unknown females, those with a - |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.Animid| that is one of: + |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.AnimID| that is one of: ``sdb_stranger_female``, ``sdb_stranger_female2``, and ``sdb_stranger_female3``. diff --git a/doc/src/tables/biography_data.m4 b/doc/src/tables/biography_data.m4 index 0e419ba..faa5740 100644 --- a/doc/src/tables/biography_data.m4 +++ b/doc/src/tables/biography_data.m4 @@ -1,4 +1,4 @@ -.. Copyright (C) 2023, 2024 The Meme Factory, Inc. www.karlpinc.com +.. Copyright (C) 2023, 2024, 2026 The Meme Factory, Inc. www.karlpinc.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -91,7 +91,7 @@ an |BIOGRAPHY_DATA.AnimID| value of ``sdb_unk``, is :ref:`special ` and cannot be altered or deleted by ordinary user accounts. Also :ref:`special ` to the system are the other -unknown individual |BIOGRAPHY_DATA.Animid| codes: +unknown individual |BIOGRAPHY_DATA.AnimID| codes: ``sdb_stranger_male``, ``sdb_stranger_female``, ``sdb_stranger_female2``, and ``sdb_stranger_female3``. diff --git a/doc/src/views.m4 b/doc/src/views.m4 index b96cb11..7cd6fce 100644 --- a/doc/src/views.m4 +++ b/doc/src/views.m4 @@ -69,7 +69,7 @@ Others reproduce common query patterns, eliminiating the need to connect +-------------------+----------------------+--------------------------+----------------------+ | |OBS| | |EVENTS| row, so one | Simplifies querying -- | |WATCHES|, |EVENTS| | | (Observations) | row for every | attaches a date and a | | -| | observed event | |BIOGRAPHY_DATA.Animid|, | | +| | observed event | |BIOGRAPHY_DATA.AnimID|, | | | | | etc., to each event. | | +-------------------+----------------------+--------------------------+----------------------+ | |PANTGRUNTS_VIEW| | |EVENTS| row related | Upload pantgrunt | |WATCHES|, |EVENTS|, | -- 2.34.1