From 00ef5670dfd15cedfc2a809ec86ec9d2e26acbbb Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 17 Jun 2026 15:17:25 +0000 Subject: [PATCH] Change symbol sdb_pantgrunt to sdb_pg_event for EVENTS.Behavior --- db/schemas/lib/triggers/create/events.m4 | 2 +- db/schemas/lib/triggers/create/pantgrunts.m4 | 6 +++--- db/schemas/lib/triggers/create/roles.m4 | 2 +- db/schemas/sokwedb/tables/create/events.m4 | 6 +++--- doc/src/tables/events.m4 | 4 ++-- doc/src/tables/pantgrunts.m4 | 2 +- include/global_constants.m4 | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/db/schemas/lib/triggers/create/events.m4 b/db/schemas/lib/triggers/create/events.m4 index d2b0b09..e5201ce 100644 --- a/db/schemas/lib/triggers/create/events.m4 +++ b/db/schemas/lib/triggers/create/events.m4 @@ -84,7 +84,7 @@ CREATE OR REPLACE FUNCTION events_func () ,'sdb_grooming' ,'sdb_groom_scan' ,'sdb_other_species' - ,'sdb_pantgrunt') THEN + ,'sdb_pg_event') THEN -- The event must be related to a follow. watch_type := 'sdb_follow'; ELSIF NEW.behavior IN ('sdb_arrival_a' diff --git a/db/schemas/lib/triggers/create/pantgrunts.m4 b/db/schemas/lib/triggers/create/pantgrunts.m4 index d9b1ac7..0bbc010 100644 --- a/db/schemas/lib/triggers/create/pantgrunts.m4 +++ b/db/schemas/lib/triggers/create/pantgrunts.m4 @@ -39,7 +39,7 @@ CREATE OR REPLACE FUNCTION pantgrunts_func () cannot_change(`PANTGRUNTS', `EID') END IF; - -- The EVENTS.Behavior must be sdb_pantgrunt + -- The EVENTS.Behavior must be sdb_pg_event IF TG_OP = 'INSERT' THEN DECLARE -- EVENTS @@ -66,13 +66,13 @@ CREATE OR REPLACE FUNCTION pantgrunts_func () JOIN watches ON (watches.wid = events.wid) LEFT OUTER JOIN roles ON (roles.eid = events.eid) WHERE events.eid = NEW.eid - AND events.behavior <> 'sdb_pantgrunt' + AND events.behavior <> 'sdb_pg_event' ORDER BY roles.participant; -- Consistent error message IF FOUND THEN RAISE EXCEPTION integrity_constraint_violation USING MESSAGE = 'Error on ' || TG_OP || ' of PANTGRUNTS' , DETAIL = 'Pantgrunts can only be related to an event with an' - || ' EVENTS.Behavior value of (sdb_pantgrunt)' + || ' EVENTS.Behavior value of (sdb_pg_event)' || ': Key (EID = (' || NEW.eid || '): Value (MultiActors) = (' diff --git a/db/schemas/lib/triggers/create/roles.m4 b/db/schemas/lib/triggers/create/roles.m4 index c21aee3..c954779 100644 --- a/db/schemas/lib/triggers/create/roles.m4 +++ b/db/schemas/lib/triggers/create/roles.m4 @@ -467,7 +467,7 @@ CREATE OR REPLACE FUNCTION roles_func () -- groom scans are - sdb_actor, sdb_actee, and sdb_mutual. -- IF TG_OP = 'INSERT' - AND (a_behavior = 'sdb_pantgrunt' + AND (a_behavior = 'sdb_pg_event' OR a_behavior = 'sdb_groom_scan_a') AND NEW.role <> 'sdb_actor' AND NEW.role <> 'sdb_actee' diff --git a/db/schemas/sokwedb/tables/create/events.m4 b/db/schemas/sokwedb/tables/create/events.m4 index cb80e69..4e71c86 100644 --- a/db/schemas/sokwedb/tables/create/events.m4 +++ b/db/schemas/sokwedb/tables/create/events.m4 @@ -73,7 +73,7 @@ CREATE TABLE events ( , 'sdb_groom_scan_a' , 'sdb_mating' , 'sdb_other_species' - , 'sdb_pantgrunt')) + , 'sdb_pg_event')) ,start TIME NOT NULL noseconds_check(`Start') CONSTRAINT "Start cannot be before sdb_min_events_start" @@ -93,7 +93,7 @@ CREATE TABLE events ( _point_behavior_time(`sdb_aggression') _point_behavior_time(`sdb_groom_scan') _point_behavior_time(`sdb_groom_scan_a') - _point_behavior_time(`sdb_pantgrunt') + _point_behavior_time(`sdb_pg_event') _point_behavior_time(`sdb_gps') _point_behavior_time(`sdb_map') @@ -101,7 +101,7 @@ CREATE TABLE events ( _behavior_certain(`sdb_groom_scan') _behavior_certain(`sdb_groom_scan_a') _behavior_certain(`sdb_other_species') - _behavior_certain(`sdb_pantgrunt') + _behavior_certain(`sdb_pg_event') _behavior_certain(`sdb_gps') _behavior_certain(`sdb_map') ); diff --git a/doc/src/tables/events.m4 b/doc/src/tables/events.m4 index 5b2d384..bd90f39 100644 --- a/doc/src/tables/events.m4 +++ b/doc/src/tables/events.m4 @@ -513,7 +513,7 @@ The following table lists these rules and implications: .. _EVENTS_pantgrunt_code: -``sdb_pantgrunt`` (Pantgrunt) +``sdb_pg_event`` (Pantgrunt) The EVENTS row must be associated with a follow. This means the |EVENTS.WID| column must reference a |WATCHES| row with a |WATCHES|.\ |WATCHES.Type| value of ``sdb_follow``. @@ -626,7 +626,7 @@ The following list summarizes the available codes: ``sdb_other_species`` (Other Species) A row must exist on |SPECIES_PRESENT| and/or on |HUMANS|. -``sdb_pantgrunt`` (Pantgrunt) +``sdb_pg_event`` (Pantgrunt) A row must exist on PANTGRUNTS. See :ref:`above ` for further detail regarding what related diff --git a/doc/src/tables/pantgrunts.m4 b/doc/src/tables/pantgrunts.m4 index bf365ca..5e910a0 100644 --- a/doc/src/tables/pantgrunts.m4 +++ b/doc/src/tables/pantgrunts.m4 @@ -46,7 +46,7 @@ There should be one row for each dyad. event recorded in the given follow at the given time.\ [#f1]_ The related |EVENTS| row must be a pantgrunt event; it must have an -|EVENTS|.\ |EVENTS.Behavior| value of ``sdb_pantgrunt``. +|EVENTS|.\ |EVENTS.Behavior| value of ``sdb_pg_event``. This related |EVENTS| row supplies the time of the pantgrunt and relates to the follow, and the |ROLES| role related to the event supplies information on the individuals involved. diff --git a/include/global_constants.m4 b/include/global_constants.m4 index dbc2977..5c9c031 100644 --- a/include/global_constants.m4 +++ b/include/global_constants.m4 @@ -136,7 +136,7 @@ define(`sdb_mating', `MATE') dnl The other species is present event define(`sdb_other_species', `OS') dnl The pantgrunt event -define(`sdb_pantgrunt', `PG') +define(`sdb_pg_event', `PG') dnl dnl FOLLOW_ARRIVALS -- 2.34.1