From 65e2fe7ffc339b8d2d829ded7b1a3c9ce394e853 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Thu, 30 Nov 2023 13:47:46 -0600 Subject: [PATCH] Change BIOGRAPHY.AnimIDNum to allow NULL, and fix constraint --- db/schemas/sokwedb/tables/create/biography.m4 | 4 +++- doc/src/tables/biography.m4 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/db/schemas/sokwedb/tables/create/biography.m4 b/db/schemas/sokwedb/tables/create/biography.m4 index f114ae8..6eda546 100644 --- a/db/schemas/sokwedb/tables/create/biography.m4 +++ b/db/schemas/sokwedb/tables/create/biography.m4 @@ -45,7 +45,9 @@ CREATE TABLE biography ( animid TEXT PRIMARY KEY NOT NULL emptytext_check(`AnimID') nospaces_check(`AnimID') - ,animidnum INT NOT NULL + ,animidnum INT + CONSTRAINT "AnimIDNum must be > 0, or NULL" + CHECK (animidnum > 0) ,animname TEXT NOT NULL emptytext_check(`AnimName') ,birthcomm TEXT NULL diff --git a/doc/src/tables/biography.m4 b/doc/src/tables/biography.m4 index e8097d0..00e2ec9 100644 --- a/doc/src/tables/biography.m4 +++ b/doc/src/tables/biography.m4 @@ -101,7 +101,7 @@ AnimIDNum (Animal IDentifier Number) .. |BIOGRAPHY.AnimIDNum_summary| replace:: A unique positive integer used to identify the chimpanzee in SIV papers. -|BIOGRAPHY.AnimIDNum_summary| |unique| |notnull| +|BIOGRAPHY.AnimIDNum_summary| |unique| |allownull| .. _BIOGRAPHY.AnimName: -- 2.34.1