From 4ea26541a3ad5f7050651c3c6d08ad5e9ec08fea Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Fri, 3 Oct 2025 22:24:36 +0000 Subject: [PATCH] Implement Start and Stop column constraints on EVENTS --- db/schemas/sokwedb/tables/create/events.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/db/schemas/sokwedb/tables/create/events.m4 b/db/schemas/sokwedb/tables/create/events.m4 index b846ba2..8fb2a19 100644 --- a/db/schemas/sokwedb/tables/create/events.m4 +++ b/db/schemas/sokwedb/tables/create/events.m4 @@ -38,8 +38,12 @@ CREATE TABLE events ( , 'sdb_pantgrunt')) ,start TIME NOT NULL noseconds_check(`Start') + CONSTRAINT "Start cannot be before sdb_min_events_start" + CHECK (start >= 'sdb_min_event_start') ,stop TIME NOT NULL noseconds_check(`Stop') + CONSTRAINT "Stop cannot be after sdb_max_events_stop" + CHECK (stop <= 'sdb_max_event_stop') ,certainty TEXT NOT NULL REFERENCES certainties ,notes TEXT NOT NULL -- 2.34.1