From 36c6d2e53188914bc063f3f7f176ba59b13d7031 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Mon, 8 Sep 2025 15:03:20 +0000 Subject: [PATCH] Make system aware of MGM, MGF, MGF2, and MGF3 unknown individuals --- db/schemas/sokwedb/tables/create/biography_data.m4 | 10 ++++++++-- doc/src/tables/biography_data.m4 | 5 ++++- include/global_constants.m4 | 8 ++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/db/schemas/sokwedb/tables/create/biography_data.m4 b/db/schemas/sokwedb/tables/create/biography_data.m4 index ca53dc5..b0dacd3 100644 --- a/db/schemas/sokwedb/tables/create/biography_data.m4 +++ b/db/schemas/sokwedb/tables/create/biography_data.m4 @@ -101,8 +101,14 @@ CREATE TABLE biography_data ( CONSTRAINT "DepartDate may not be before EntryDate" CHECK (entrydate <= departdate) CONSTRAINT "BDMin and DepartDate may not be more than sdb_max_lifespan years apart" - CHECK (bdmin - >= departdate - 'sdb_max_lifespan sdb_max_lifespan_units'::interval) + CHECK ((animid = 'sdb_unk' + OR animid = 'sdb_stranger_male' + OR animid = 'sdb_stranger_female' + OR animid = 'sdb_stranger_female2' + OR animid = 'sdb_stranger_female3') + OR bdmin + >= departdate + - 'sdb_max_lifespan sdb_max_lifespan_units'::interval) ); grant_priv(`BIOGRAPHY_DATA') diff --git a/doc/src/tables/biography_data.m4 b/doc/src/tables/biography_data.m4 index f922439..8881205 100644 --- a/doc/src/tables/biography_data.m4 +++ b/doc/src/tables/biography_data.m4 @@ -78,7 +78,10 @@ not be before the date the individual entered the study The maximum age of an individual, the time span between the individual's earliest possible birth date (|BIOGRAPHY_DATA.BDMin|) and their |BIOGRAPHY_DATA.DepartDate|, may not be more than sdb_max_lifespan -sdb_max_lifespan_units. +sdb_max_lifespan_units, unless the individual is one of the unknown +individuals, one with a |BIOGRAPHY_DATA.AnimID| of one of: +``sdb_unk``, ``sdb_stranger_male``, ``sdb_stranger_female``, +``sdb_stranger_female2``, or ``sdb_stranger_female3``. sdb_null_iff_null(*m4[|BIOGRAPHY_DATA.DadPrelim|]m4*,*m4[|BIOGRAPHY_DATA.DadID|]m4*) sdb_null_iff_null(*m4[|BIOGRAPHY_DATA.DadIDPub|]m4*,*m4[|BIOGRAPHY_DATA.DadID|]m4*) diff --git a/include/global_constants.m4 b/include/global_constants.m4 index 69a7957..6294d9a 100644 --- a/include/global_constants.m4 +++ b/include/global_constants.m4 @@ -56,6 +56,14 @@ dnl dnl The unknown chimp define(`sdb_unk', `UNK') +dnl Stranger male +define(`sdb_stranger_male', `MGM') +dnl Stranger female +define(`sdb_stranger_female', `MGF') +dnl Stranger female +define(`sdb_stranger_female2', `MGF2') +dnl Stranger female +define(`sdb_stranger_female3', `MGF3') dnl BCCertainty define(`sdb_bg_certain', `C') -- 2.34.1