From 457e34d83a642c0f5946b16dcef3ad765ba47850 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Mon, 8 Sep 2025 15:28:55 +0000 Subject: [PATCH] Initial list of event codes, without hyperlinking to relevant tables --- db/schemas/sokwedb/tables/create/events.m4 | 8 ++++++++ doc/src/tables/events.m4 | 22 ++++++++++++++++++++++ include/global_constants.m4 | 18 ++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/db/schemas/sokwedb/tables/create/events.m4 b/db/schemas/sokwedb/tables/create/events.m4 index 1a48490..b846ba2 100644 --- a/db/schemas/sokwedb/tables/create/events.m4 +++ b/db/schemas/sokwedb/tables/create/events.m4 @@ -28,6 +28,14 @@ CREATE TABLE events ( ,fid INTEGER NOT NULL REFERENCES follows ,behavior TEXT NOT NULL + CONSTRAINT "Behavior must be one of: sdb_aggression, sdb_arrival, sdb_foo, sdb_grooming, sdb_mating, sdb_other_species, sdb_pantgrunt" + CHECK (behavior IN ('sdb_aggression' + , 'sdb_arrival' + , 'sdb_food' + , 'sdb_grooming' + , 'sdb_mating' + , 'sdb_other_species' + , 'sdb_pantgrunt')) ,start TIME NOT NULL noseconds_check(`Start') ,stop TIME NOT NULL diff --git a/doc/src/tables/events.m4 b/doc/src/tables/events.m4 index 485f3c3..96fdcad 100644 --- a/doc/src/tables/events.m4 +++ b/doc/src/tables/events.m4 @@ -72,6 +72,28 @@ Each code has special meaning to SokweDB, controlling what additional information may, or must, be related to the event. In other words, what other tables may, or must, contain additional information about the event. +The following list summarizes the available codes: + +``sdb_aggression`` (Aggression) + A row must exist on AGGRESSIONS. + +``sdb_arrival`` (Arrival) + A row must exist on ARRIVALS. + +``sdb_food`` (Food) + A row must exist on FOOD_EVENTS. + +``sdb_grooming`` (Grooming) + A row must exist on GROOMINGS. + +``sdb_mating`` (Mating) + A row must exist on MATINGS. + +``sdb_other_species`` (Other Species) + A row must exist on SPECIES_PRESENT and/or on HUMANS. + +``sdb_pantgrunt`` (Pantgrunt) + A row must exist on PANTGRUNTS. |notnull| diff --git a/include/global_constants.m4 b/include/global_constants.m4 index 6294d9a..14d42aa 100644 --- a/include/global_constants.m4 +++ b/include/global_constants.m4 @@ -95,6 +95,24 @@ dnl dnl The unknown community define(`sdb_unknown_comm', `Unknown') +dnl +dnl EVENTS +dnl +dnl The aggression event +define(`sdb_aggression', `AGG') +dnl The arrival event +define(`sdb_arrival', `ARR') +dnl The food/eating event +define(`sdb_food', `FOOD') +dnl The grooming event +define(`sdb_grooming', `GROOM') +dnl The mating event +define(`sdb_mating', `MATE') +dnl The other species is present event +define(`sdb_other_species', `OS') +dnl The pantgrunt event +define(`sdb_pantgrunt', `PG') + dnl dnl FOLLOW_ARRIVALS dnl -- 2.34.1