From bfe5064833a245a87e489334c0c7288eb141009f Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Thu, 18 Jan 2024 21:38:01 +0000 Subject: [PATCH] Have BIOGRAPHY.DadIDPub follow the same NULL rules as DadPrelim This change is questionable, since querying on DadIDPub would be slightly wonky. But we don't really anticipate queries. --- db/schemas/sokwedb/tables/create/biography.m4 | 3 ++- doc/src/tables/biography.m4 | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/db/schemas/sokwedb/tables/create/biography.m4 b/db/schemas/sokwedb/tables/create/biography.m4 index 0a751d6..f59f212 100644 --- a/db/schemas/sokwedb/tables/create/biography.m4 +++ b/db/schemas/sokwedb/tables/create/biography.m4 @@ -66,8 +66,9 @@ CREATE TABLE biography ( ,animid_type_column(`dadid', `DadID', `NULL') ,dadprelim BOOLEAN null_iff_null(`DadPrelim', `DadID') - ,dadidpub TEXT NOT NULL + ,dadidpub TEXT emptytext_check(`DadIDPub') + null_iff_null(`DadIDPub', `DadID') ,firstborn CHAR(1) NOT NULL CONSTRAINT "FirstBorn must be one of: sdb_firstborn sdb_not_firstborn sdb_unk_firstborn" diff --git a/doc/src/tables/biography.m4 b/doc/src/tables/biography.m4 index dc9fe36..de26228 100644 --- a/doc/src/tables/biography.m4 +++ b/doc/src/tables/biography.m4 @@ -204,7 +204,10 @@ DadIDPub (Publication of Paternity) Citation of the publication where paternity was declared, or 'Unknown' when paternity has not yet been published. -|BIOGRAPHY.DadIDPub_summary| |emptytext| |notnull| +|BIOGRAPHY.DadIDPub_summary| |emptytext| +sdb_null_iff_null({|BIOGRAPHY.DadID|}) + +|allownull| .. _BIOGRAPHY.FirstBorn: -- 2.34.1