From 469b1a3017c13b83e1ecea18b287f202f5148a99 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 20 May 2026 14:25:28 +0000 Subject: [PATCH] Place an upper limit (2) on the foods consumed per food event --- db/schemas/sokwedb/tables/create/food_events.m4 | 2 ++ doc/src/tables/food_events.m4 | 3 +++ include/limits.m4 | 3 +++ 3 files changed, 8 insertions(+) diff --git a/db/schemas/sokwedb/tables/create/food_events.m4 b/db/schemas/sokwedb/tables/create/food_events.m4 index 76a56ba..1492726 100644 --- a/db/schemas/sokwedb/tables/create/food_events.m4 +++ b/db/schemas/sokwedb/tables/create/food_events.m4 @@ -39,6 +39,8 @@ CREATE TABLE food_events ( notonlyspaces_check(`FoodNameWritten') ,seq INTEGER NOT NULL positive_check(`Seq') + CONSTRAINT "Seq must be <= sdb_max_foods" + CHECK (seq <= sdb_max_foods) ); grant_priv(`FOOD_EVENTS') diff --git a/doc/src/tables/food_events.m4 b/doc/src/tables/food_events.m4 index a7a1028..5e0b81b 100644 --- a/doc/src/tables/food_events.m4 +++ b/doc/src/tables/food_events.m4 @@ -162,6 +162,9 @@ Seq (written Sequencing) a food bout. |FOOD_EVENTS.Seq_summary| +There can be, at most, sdb_max_foods foods consumed per food event. +This means that the value of this column cannot be more than +``sdb_max_foods``. The value of this column may not be useful, or have any real significance. diff --git a/include/limits.m4 b/include/limits.m4 index a5399b0..31f2c47 100644 --- a/include/limits.m4 +++ b/include/limits.m4 @@ -82,5 +82,8 @@ define(`sdb_first_memb_log_date', `2013-12-01') dnl The earliest possible AGGRESSION_EVENT_LOG.Year value define(`sdb_first_aggression_event_log_year', `1960') +dnl The maximal number of foods consumed per food event (FOOD_EVENTS) +define(`sdb_max_foods', `2') + divert(`0')dnl Output with m4 again ]}])dnl End of ifdef over the whole file. -- 2.34.1