From 51e1d4e29e03044f4d7180e83ce71d7e0ad1eec6 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 27 May 2026 23:46:36 +0000 Subject: [PATCH] Change column name: FOLLOWS.Community -> CommID Make consistent with other column names. Per 2026-05-26 meeting. --- conversion/load_follow_to_follows.sql | 2 +- .../lib/triggers/create/biography_data.m4 | 20 ++-- .../lib/triggers/create/follow_observers.m4 | 12 +-- db/schemas/lib/triggers/create/follows.m4 | 24 ++--- db/schemas/lib/triggers/create/roles.m4 | 92 +++++++++---------- db/schemas/sokwedb/indexes/create/follows.m4 | 6 +- db/schemas/sokwedb/indexes/drop/follows.m4 | 4 +- db/schemas/sokwedb/tables/create/follows.m4 | 4 +- doc/diagrams/follows.svg | 2 +- doc/src/epilog.inc.m4 | 4 +- doc/src/tables/aggressions.m4 | 4 +- doc/src/tables/follows.m4 | 12 +-- 12 files changed, 93 insertions(+), 93 deletions(-) diff --git a/conversion/load_follow_to_follows.sql b/conversion/load_follow_to_follows.sql index 8bce4f7..9a54294 100644 --- a/conversion/load_follow_to_follows.sql +++ b/conversion/load_follow_to_follows.sql @@ -57,7 +57,7 @@ $$; -- INSERT INTO follows ( focal -, community +, commid , date , notes) SELECT fol_b_animid diff --git a/db/schemas/lib/triggers/create/biography_data.m4 b/db/schemas/lib/triggers/create/biography_data.m4 index cbd683e..dfbfabb 100644 --- a/db/schemas/lib/triggers/create/biography_data.m4 +++ b/db/schemas/lib/triggers/create/biography_data.m4 @@ -171,7 +171,7 @@ CREATE OR REPLACE FUNCTION biography_data_func () BEGIN -- Function for biography_data insert and update triggers -- - -- AGPL_notice(` --', `2023, 2024, 2025', + -- AGPL_notice(` --', `2023-2026', `The Meme Factory, Inc., www.karlpinc.com') IF TG_OP = 'UPDATE' THEN @@ -439,13 +439,13 @@ CREATE OR REPLACE FUNCTION biography_data_func () -- FOLLOWS DECLARE a_fid follows.fid%TYPE; - a_community follows.community%TYPE; + a_commid follows.commid%TYPE; a_date follows.date%TYPE; BEGIN -- Cannot have a follow before the individual was studied. IF NEW.entrydate <> OLD.entrydate THEN - SELECT follows.fid, follows.community, follows.date - INTO a_fid , a_community , a_date + SELECT follows.fid, follows.commid, follows.date + INTO a_fid , a_commid , a_date FROM follows WHERE follows.focal = NEW.animid AND follows.date < NEW.entrydate @@ -463,16 +463,16 @@ CREATE OR REPLACE FUNCTION biography_data_func () || a_fid || '), Value (Date) = (' || a_date - || '), Value (Community) = (' - || a_community + || '), Value (CommID) = (' + || a_commid || ')'; END IF; END IF; -- Cannot have a follow after study of the individual has ceased. IF NEW.departdate <> OLD.departdate THEN - SELECT follows.fid, follows.community, follows.date - INTO a_fid , a_community , a_date + SELECT follows.fid, follows.commid, follows.date + INTO a_fid , a_commid , a_date FROM follows WHERE follows.focal = NEW.animid AND follows.date > NEW.departdate @@ -490,8 +490,8 @@ CREATE OR REPLACE FUNCTION biography_data_func () || a_fid || '), Value (Date) = (' || a_date - || '), Value (Community) = (' - || a_community + || '), Value (CommID) = (' + || a_commid || ')'; END IF; END IF; diff --git a/db/schemas/lib/triggers/create/follow_observers.m4 b/db/schemas/lib/triggers/create/follow_observers.m4 index f55c3f9..b7a6e5d 100644 --- a/db/schemas/lib/triggers/create/follow_observers.m4 +++ b/db/schemas/lib/triggers/create/follow_observers.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2025 The Meme Factory, Inc. http://www.karlpinc.com/ +dnl Copyright (C) 2025, 2026 The Meme Factory, Inc. http://www.karlpinc.com/ dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU Affero General Public License as published by @@ -31,7 +31,7 @@ CREATE OR REPLACE FUNCTION follow_observers_func () BEGIN -- Function for follow_observers insert and update triggers -- - -- AGPL_notice(` --', `2025', + -- AGPL_notice(` --', `2025, 2026', `The Meme Factory, Inc., www.karlpinc.com') IF TG_OP = 'UPDATE' THEN @@ -48,8 +48,8 @@ CREATE OR REPLACE FUNCTION follow_observers_func () || '): ' || (SELECT 'Value (FOLLOWS.Focal) = (' || follows.focal - || '): Value (FOLLOWS.Community) = (' - || follows.community + || '): Value (FOLLOWS.CommID) = (' + || follows.commid || '): Value (FOLLOWS.Date) = (' || follows.date || '): ' @@ -66,8 +66,8 @@ CREATE OR REPLACE FUNCTION follow_observers_func () || '): ' || (SELECT 'Value (FOLLOWS.Focal) = (' || follows.focal - || '): Value (FOLLOWS.Community) = (' - || follows.community + || '): Value (FOLLOWS.CommID) = (' + || follows.commid || '): Value (FOLLOWS.Date) = (' || follows.date || '): ' diff --git a/db/schemas/lib/triggers/create/follows.m4 b/db/schemas/lib/triggers/create/follows.m4 index 4151438..8567c21 100644 --- a/db/schemas/lib/triggers/create/follows.m4 +++ b/db/schemas/lib/triggers/create/follows.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2025 The Meme Factory, Inc. http://www.karlpinc.com/ +dnl Copyright (C) 2025, 2026 The Meme Factory, Inc. 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 @@ -43,7 +43,7 @@ CREATE OR REPLACE FUNCTION follows_func () BEGIN -- Function for follows insert and update triggers -- - -- AGPL_notice(` --', `2025', + -- AGPL_notice(` --', `2025, 2026', `The Meme Factory, Inc., www.karlpinc.com') IF TG_OP = 'UPDATE' THEN @@ -72,8 +72,8 @@ CREATE OR REPLACE FUNCTION follows_func () || NEW.focal || '), Value (Date) = (' || NEW.Date - || '), Value (Community) = (' - || NEW.community + || '), Value (CommID) = (' + || NEW.commid || '), Value (BIOGRAPHY_DATA.EntryDate) = (' || this_entrydate || ')'; @@ -101,8 +101,8 @@ CREATE OR REPLACE FUNCTION follows_func () || NEW.focal || '), Value (Date) = (' || NEW.Date - || '), Value (Community) = (' - || NEW.community + || '), Value (CommID) = (' + || NEW.commid || '), Value (BIOGRAPHY_DATA.DepartDate) = (' || this_departdate || ')'; @@ -151,8 +151,8 @@ CREATE OR REPLACE FUNCTION follows_func () || NEW.fid || '), Value (Focal) = (' || NEW.focal - || '), Value (Community) = (' - || NEW.community + || '), Value (CommID) = (' + || NEW.commid || '), Value (Date) = (' || NEW.date || '): Key (EVENTS.EID) = (' @@ -203,8 +203,8 @@ CREATE OR REPLACE FUNCTION follows_func () || NEW.fid || '), Value (Focal) = (' || NEW.focal - || '), Value (Community) = (' - || NEW.community + || '), Value (CommID) = (' + || NEW.commid || '), Value (Date) = (' || NEW.date || '): Key (EVENTS.EID) = (' @@ -601,8 +601,8 @@ CREATE OR REPLACE FUNCTION follows_commit_func () || NEW.focal || '), Value (Date) = (' || NEW.Date - || '), Value (Community) = (' - || NEW.community + || '), Value (CommID) = (' + || NEW.commid || ')'; END IF; diff --git a/db/schemas/lib/triggers/create/roles.m4 b/db/schemas/lib/triggers/create/roles.m4 index 2da7159..179d63d 100644 --- a/db/schemas/lib/triggers/create/roles.m4 +++ b/db/schemas/lib/triggers/create/roles.m4 @@ -175,13 +175,13 @@ CREATE OR REPLACE FUNCTION roles_func () a_participant roles.participant%TYPE; a_focal follows.focal%TYPE; a_date follows.date%TYPE; - a_community follows.community%TYPE; + a_commid follows.commid%TYPE; BEGIN SELECT roles.pid, roles.role, roles.participant - , follows.focal, follows.date, follows.community + , follows.focal, follows.date, follows.commid INTO a_pid , a_role , a_participant - , a_focal , a_date , a_community + , a_focal , a_date , a_commid FROM roles , follows WHERE roles.eid = NEW.eid @@ -219,8 +219,8 @@ CREATE OR REPLACE FUNCTION roles_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')'; END IF; END; @@ -239,7 +239,7 @@ CREATE OR REPLACE FUNCTION roles_func () a_participant roles.participant%TYPE; a_focal follows.focal%TYPE; a_date follows.date%TYPE; - a_community follows.community%TYPE; + a_commid follows.commid%TYPE; BEGIN -- @@ -251,8 +251,8 @@ CREATE OR REPLACE FUNCTION roles_func () AND NEW.role <> 'sdb_actee' THEN -- The ROLES rows for aggression events must have -- a role of sdb_actor or sdb_actee. - SELECT follows.focal, follows.date, follows.community - INTO a_focal , a_date , a_community + SELECT follows.focal, follows.date, follows.commid + INTO a_focal , a_date , a_commid FROM follows WHERE follows.fid = a_fid; IF FOUND THEN @@ -279,8 +279,8 @@ CREATE OR REPLACE FUNCTION roles_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')' , HINT = 'The ROLES.Role must be either (sdb_actor)' || ' or (sdb_actee) for an event' @@ -293,9 +293,9 @@ CREATE OR REPLACE FUNCTION roles_func () -- There can be only one row with each aggression/grooming role per -- aggression/grooming event. SELECT roles.pid, roles.role, roles.participant - , follows.focal, follows.date, follows.community + , follows.focal, follows.date, follows.commid INTO a_pid , a_role , a_participant - , a_focal , a_date , a_community + , a_focal , a_date , a_commid FROM roles , follows WHERE roles.eid = NEW.eid @@ -339,8 +339,8 @@ CREATE OR REPLACE FUNCTION roles_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')'; END IF; END; @@ -354,11 +354,11 @@ CREATE OR REPLACE FUNCTION roles_func () DECLARE a_focal follows.focal%TYPE; a_date follows.date%TYPE; - a_community follows.community%TYPE; + a_commid follows.commid%TYPE; BEGIN - SELECT follows.focal, follows.date, follows.community - INTO a_focal , a_date , a_community + SELECT follows.focal, follows.date, follows.commid + INTO a_focal , a_date , a_commid FROM follows WHERE follows.fid = a_fid AND NEW.participant <> follows.focal; @@ -386,8 +386,8 @@ CREATE OR REPLACE FUNCTION roles_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')'; END IF; END; @@ -406,13 +406,13 @@ CREATE OR REPLACE FUNCTION roles_func () a_role roles.role%TYPE; a_focal follows.focal%TYPE; a_date follows.date%TYPE; - a_community follows.community%TYPE; + a_commid follows.commid%TYPE; BEGIN SELECT roles.pid, roles.role - , follows.focal, follows.date, follows.community + , follows.focal, follows.date, follows.commid INTO a_pid , a_role - , a_focal , a_date , a_community + , a_focal , a_date , a_commid FROM roles , follows WHERE roles.eid = NEW.eid @@ -456,8 +456,8 @@ CREATE OR REPLACE FUNCTION roles_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')' , HINT = 'The participants in an ' || a_behavior @@ -485,7 +485,7 @@ CREATE OR REPLACE FUNCTION roles_insert_commit_func () a_fid follows.fid%TYPE; a_focal follows.focal%TYPE; a_date follows.date%TYPE; - a_community follows.community%TYPE; + a_commid follows.commid%TYPE; missing_role role_codes.role%TYPE; @@ -507,9 +507,9 @@ CREATE OR REPLACE FUNCTION roles_insert_commit_func () END CASE; SELECT events.behavior ,events.start, events.stop - , follows.fid, follows.focal, follows.date, follows.community + , follows.fid, follows.focal, follows.date, follows.commid INTO a_behavior , a_start , a_stop - , a_fid , a_focal , a_date , a_community + , a_fid , a_focal , a_date , a_commid FROM events JOIN follows ON (follows.fid = events.fid) WHERE events.eid = NEW.eid @@ -546,8 +546,8 @@ CREATE OR REPLACE FUNCTION roles_insert_commit_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')'; END IF; END IF; @@ -556,9 +556,9 @@ CREATE OR REPLACE FUNCTION roles_insert_commit_func () -- the focal and must be the sdb_actor or the sdb_actee SELECT events.behavior ,events.start, events.stop - , follows.fid, follows.focal, follows.date, follows.community + , follows.fid, follows.focal, follows.date, follows.commid INTO a_behavior , a_start , a_stop - , a_fid , a_focal , a_date , a_community + , a_fid , a_focal , a_date , a_commid FROM events JOIN follows ON (follows.fid = events.fid) WHERE events.eid = NEW.eid @@ -597,8 +597,8 @@ CREATE OR REPLACE FUNCTION roles_insert_commit_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')'; END IF; @@ -623,7 +623,7 @@ CREATE OR REPLACE FUNCTION roles_delete_commit_func () a_fid follows.fid%TYPE; a_focal follows.focal%TYPE; a_date follows.date%TYPE; - a_community follows.community%TYPE; + a_commid follows.commid%TYPE; -- GROOMINGS a_initiator groomings.initiator%TYPE; @@ -669,9 +669,9 @@ CREATE OR REPLACE FUNCTION roles_delete_commit_func () AND actee_count = 0)) THEN SELECT events.behavior ,events.start, events.stop - , follows.fid, follows.focal, follows.date, follows.community + , follows.fid, follows.focal, follows.date, follows.commid INTO a_behavior , a_start , a_stop - , a_fid , a_focal , a_date , a_community + , a_fid , a_focal , a_date , a_commid FROM events JOIN follows ON (follows.fid = events.fid) WHERE events.eid = OLD.eid; @@ -706,8 +706,8 @@ CREATE OR REPLACE FUNCTION roles_delete_commit_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')'; END IF; END; @@ -717,9 +717,9 @@ CREATE OR REPLACE FUNCTION roles_delete_commit_func () -- the focal, who must be either the sdb_actor or the sdb_actee SELECT events.behavior ,events.start, events.stop - , follows.fid, follows.focal, follows.date, follows.community + , follows.fid, follows.focal, follows.date, follows.commid INTO a_behavior , a_start , a_stop - , a_fid , a_focal , a_date , a_community + , a_fid , a_focal , a_date , a_commid FROM events JOIN follows ON (follows.fid = events.fid) WHERE events.eid = OLD.eid @@ -759,8 +759,8 @@ CREATE OR REPLACE FUNCTION roles_delete_commit_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || ')'; END IF; @@ -768,11 +768,11 @@ CREATE OR REPLACE FUNCTION roles_delete_commit_func () -- a participant and an sdb_actor or an sdb_actee. SELECT events.behavior ,events.start, events.stop - , follows.fid, follows.focal, follows.date, follows.community + , follows.fid, follows.focal, follows.date, follows.commid , groomings.initiator, groomings.terminator , groomings.problems, groomings.extractedby INTO a_behavior , a_start , a_stop - , a_fid , a_focal , a_date , a_community + , a_fid , a_focal , a_date , a_commid , a_initiator , a_terminator , a_problems , a_extractedby FROM events @@ -823,8 +823,8 @@ CREATE OR REPLACE FUNCTION roles_delete_commit_func () || a_focal || '), Value (FOLLOWS.Date) = (' || a_date - || '), Value (FOLLOWS.Community) = (' - || a_community + || '), Value (FOLLOWS.CommID) = (' + || a_commid || '), Value (GROOMINGS.Initiator) = (' || textualize(`a_initiator') || '), Value (GROOMINGS.Terminator) = (' diff --git a/db/schemas/sokwedb/indexes/create/follows.m4 b/db/schemas/sokwedb/indexes/create/follows.m4 index 6b13771..7d00ae2 100644 --- a/db/schemas/sokwedb/indexes/create/follows.m4 +++ b/db/schemas/sokwedb/indexes/create/follows.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2025 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl Copyright (C) 2025, 2026 The Meme Factory, Inc., http://www.karlpinc.com/ dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU Affero General Public License as published @@ -28,5 +28,5 @@ CREATE UNIQUE INDEX IF NOT EXISTS CREATE INDEX IF NOT EXISTS follows_focal ON follows (focal); -CREATE INDEX IF NOT EXISTS follows_community ON follows - (community); +CREATE INDEX IF NOT EXISTS follows_commid ON follows + (commid); diff --git a/db/schemas/sokwedb/indexes/drop/follows.m4 b/db/schemas/sokwedb/indexes/drop/follows.m4 index d2569cf..aa4619b 100644 --- a/db/schemas/sokwedb/indexes/drop/follows.m4 +++ b/db/schemas/sokwedb/indexes/drop/follows.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2025 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl Copyright (C) 2025, 2026 The Meme Factory, Inc., http://www.karlpinc.com/ dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU Affero General Public License as published @@ -26,4 +26,4 @@ DROP INDEX IF EXISTS "On FOLLOWS, Date + Focal must be unique"; DROP INDEX IF EXISTS follows_focal; -DROP INDEX IF EXISTS follows_community; +DROP INDEX IF EXISTS follows_commid; diff --git a/db/schemas/sokwedb/tables/create/follows.m4 b/db/schemas/sokwedb/tables/create/follows.m4 index ee156e6..212a8b5 100644 --- a/db/schemas/sokwedb/tables/create/follows.m4 +++ b/db/schemas/sokwedb/tables/create/follows.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2025 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl Copyright (C) 2025, 2026 The Meme Factory, Inc., http://www.karlpinc.com/ dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU Affero General Public License as published @@ -43,7 +43,7 @@ changequote(`,') CREATE TABLE follows ( key_column(`FOLLOWS', `FID', INTEGER) ,animid_type_column(`focal', `Focal', `NOT NULL') - ,community TEXT NOT NULL + ,commid TEXT NOT NULL ,date DATE NOT NULL CONSTRAINT "The FOLLOWS.Date must not be before sdb_min_follow_date" CHECK(date >= 'sdb_min_follow_date') diff --git a/doc/diagrams/follows.svg b/doc/diagrams/follows.svg index 9211d75..bc82144 100644 --- a/doc/diagrams/follows.svg +++ b/doc/diagrams/follows.svg @@ -1495,7 +1495,7 @@ id="tspan2100-9-1-3-1-7-9-3" x="101.49867" y="96.196442" - style="stroke-width:0.264583px">CommunityCommID` .. |FOLLOWS.Focal| replace:: :ref:`Focal ` -.. |FOLLOWS.Community| replace:: - :ref:`Community ` +.. |FOLLOWS.CommID| replace:: + :ref:`CommID ` .. |FOLLOWS.Notes| replace:: :ref:`Notes ` .. |FOLLOWS.Date| replace:: diff --git a/doc/src/tables/aggressions.m4 b/doc/src/tables/aggressions.m4 index b7ad568..0c22ca0 100644 --- a/doc/src/tables/aggressions.m4 +++ b/doc/src/tables/aggressions.m4 @@ -58,7 +58,7 @@ supplies information on the individuals involved. The system will generate a warning if the community of the follow is not the community associated with the aggression event. This means, if the AGGRESSIONS.\ |AGGRESSIONS.CommID| is not the -|FOLLOWS|.\ |FOLLOWS.Community| of the follow. +|FOLLOWS|.\ |FOLLOWS.CommID| of the follow. For further information, including additional data integrity rules, see the documentation of the :ref:`EVENTS ` @@ -314,7 +314,7 @@ The |COMM_IDS|.\ |COMM_IDS.CommID| of the of the focal. .. note:: This is not the canonical source of information on the focal's community at the time of observation or :ref:`the community under - observation when the data was collected `. + observation when the data was collected `. It may, in fact, differ from the community recorded elsewhere. |notnull| diff --git a/doc/src/tables/follows.m4 b/doc/src/tables/follows.m4 index 61ca00d..ab4d915 100644 --- a/doc/src/tables/follows.m4 +++ b/doc/src/tables/follows.m4 @@ -1,4 +1,4 @@ -.. Copyright (C) 2024 The Meme Factory, Inc. www.karlpinc.com +.. Copyright (C) 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 @@ -75,12 +75,12 @@ Focal (Focal animal id) |FOLLOWS.Focal_summary| |notnull| -.. _FOLLOWS.Community: +.. _FOLLOWS.CommID: -Community -````````` +CommID +`````` -.. |FOLLOWS.Community_summary| replace:: +.. |FOLLOWS.CommID_summary| replace:: A code for the community the observers are associated with and intended to follow; the |COMM_IDS|.\ |COMM_IDS.CommID| of the @@ -88,7 +88,7 @@ Community This is not necessarily the community the focal is a member of, although it usually is. -|FOLLOWS.Community_summary| |cannot_change| |notnull| +|FOLLOWS.CommID_summary| |cannot_change| |notnull| .. _FOLLOWS.Date: -- 2.34.1