From 80ef67d7bfdf35166124642dd5b6176c4709cdd6 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Fri, 19 Jan 2024 14:39:02 +0000 Subject: [PATCH] Enforce rule that EntryDate <= DepartDate --- db/schemas/sokwedb/tables/create/biography.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/schemas/sokwedb/tables/create/biography.m4 b/db/schemas/sokwedb/tables/create/biography.m4 index f59f212..25b235f 100644 --- a/db/schemas/sokwedb/tables/create/biography.m4 +++ b/db/schemas/sokwedb/tables/create/biography.m4 @@ -90,6 +90,8 @@ CREATE TABLE biography ( CONSTRAINT "EntryType must be a ENTRYTYPES.EntryType value" REFERENCES entrytypes (entrytype) ,departdate DATE NOT NULL + CONSTRAINT "DepartDate must not be before EntryDate" + CHECK(departdate >= entrydate) ,departtype CHAR(1) NOT NULL CONSTRAINT "DepartType must be a DEPARTTYPES.DepartType value" REFERENCES departtypes (departtype) -- 2.34.1