From 6a1a6e64cf8b0411545e72482fedc2446330870b Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 13 May 2026 20:15:44 +0000 Subject: [PATCH] Put lower bound on SIGHTINGS.Date --- db/schemas/sokwedb/tables/create/sightings.m4 | 2 ++ doc/src/analyzed/sightings.m4 | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/db/schemas/sokwedb/tables/create/sightings.m4 b/db/schemas/sokwedb/tables/create/sightings.m4 index a7089d2..aec2c41 100644 --- a/db/schemas/sokwedb/tables/create/sightings.m4 +++ b/db/schemas/sokwedb/tables/create/sightings.m4 @@ -26,6 +26,8 @@ dnl CREATE TABLE sightings ( key_column(`SIGHTINGS', `SightID', INTEGER) ,date DATE NOT NULL + CONSTRAINT "Date cannot be before sdb_min_follow_date" + CHECK (date >= 'sdb_min_follow_date') ,animid_column ,commid TEXT NOT NULL CONSTRAINT "CommID must be a COMM_IDS.CommID value" diff --git a/doc/src/analyzed/sightings.m4 b/doc/src/analyzed/sightings.m4 index 73929df..4ba8f88 100644 --- a/doc/src/analyzed/sightings.m4 +++ b/doc/src/analyzed/sightings.m4 @@ -96,7 +96,9 @@ Date .. |SIGHTINGS.Date_summary| replace:: The date the individual was sighted. -|SIGHTINGS.Date_summary| |notnull| +|SIGHTINGS.Date_summary| +The date may not be before ``sdb_min_follow_date``. +|notnull| .. _SIGHTINGS.AnimID: -- 2.34.1