From 0b4e47fae0ecda5c7a17f848d14495874ca58eed Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 13 May 2026 23:58:49 +0000 Subject: [PATCH] Create, document, and index FOOD_PARTS table --- db/schemas/codes/indexes/Makefile | 1 + db/schemas/codes/indexes/create/food_parts.m4 | 29 +++++++++++++ db/schemas/codes/indexes/drop/food_parts.m4 | 25 +++++++++++ db/schemas/codes/tables/Makefile | 1 + db/schemas/codes/tables/create/food_parts.m4 | 29 +++++++++++++ doc/src/code_tables.m4 | 43 +++++++++++++++++++ doc/src/epilog.inc.m4 | 4 ++ 7 files changed, 132 insertions(+) create mode 100644 db/schemas/codes/indexes/create/food_parts.m4 create mode 100644 db/schemas/codes/indexes/drop/food_parts.m4 create mode 100644 db/schemas/codes/tables/create/food_parts.m4 diff --git a/db/schemas/codes/indexes/Makefile b/db/schemas/codes/indexes/Makefile index 06d208b..28b19e0 100644 --- a/db/schemas/codes/indexes/Makefile +++ b/db/schemas/codes/indexes/Makefile @@ -24,6 +24,7 @@ ORDER := arrival_sources \ comm_membs_sources \ cycle_states \ dad_statuses \ + food_parts \ obs_periods \ people \ role_codes \ diff --git a/db/schemas/codes/indexes/create/food_parts.m4 b/db/schemas/codes/indexes/create/food_parts.m4 new file mode 100644 index 0000000..6b0d718 --- /dev/null +++ b/db/schemas/codes/indexes/create/food_parts.m4 @@ -0,0 +1,29 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published +dnl by the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Karl O. Pinc +dnl +dnl +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`indexmacros.m4')dnl + +CREATE UNIQUE INDEX IF NOT EXISTS + food_parts_part_uniquenocase ON food_parts + (sdb_case_equivalence(part)); +CREATE UNIQUE INDEX IF NOT EXISTS + food_parts_description_uniquenocase ON food_parts + (sdb_case_equivalence(description)); diff --git a/db/schemas/codes/indexes/drop/food_parts.m4 b/db/schemas/codes/indexes/drop/food_parts.m4 new file mode 100644 index 0000000..9605cba --- /dev/null +++ b/db/schemas/codes/indexes/drop/food_parts.m4 @@ -0,0 +1,25 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published +dnl by the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Karl O. Pinc +dnl +dnl +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`indexmacros.m4')dnl + +DROP INDEX IF EXISTS food_parts_part_uniquenocase; +DROP INDEX IF EXISTS food_parts_description_uniquenocase; diff --git a/db/schemas/codes/tables/Makefile b/db/schemas/codes/tables/Makefile index 59cf842..90611a5 100644 --- a/db/schemas/codes/tables/Makefile +++ b/db/schemas/codes/tables/Makefile @@ -29,6 +29,7 @@ ORDER := agg_severities \ dad_statuses \ departtypes \ entrytypes \ + food_parts \ people \ obs_periods \ role_codes \ diff --git a/db/schemas/codes/tables/create/food_parts.m4 b/db/schemas/codes/tables/create/food_parts.m4 new file mode 100644 index 0000000..5d9a1da --- /dev/null +++ b/db/schemas/codes/tables/create/food_parts.m4 @@ -0,0 +1,29 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published +dnl by the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Karl O. Pinc +dnl +dnl +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`tablemacros.m4')dnl +include(`grants.m4')dnl +dnl + +support_table(`FOOD_PARTS', `Part', `TEXT', ` + emptytext_check(`Part') + notonlyspaces_check(`Part')' +) diff --git a/doc/src/code_tables.m4 b/doc/src/code_tables.m4 index 0badc0a..5cd5737 100644 --- a/doc/src/code_tables.m4 +++ b/doc/src/code_tables.m4 @@ -555,6 +555,49 @@ Description |ENTRYTYPES.Description_summary| |emptytext| |notnull| +.. _FOOD_PARTS: + +FOOD_PARTS (Parts of Foods) +--------------------------- +.. |FOOD_PARTS_summary| replace:: + Each row represents a food part classification. + +|FOOD_PARTS_summary| + + +.. _FOOD_PARTS_special_values: + +Special Values +`````````````` + +None. + + +Column Descriptions +``````````````````` + +.. _FOOD_PARTS.Part: + +Part +'''' + +.. |FOOD_PARTS.Part_summary| replace:: + A short sequence of characters which identify the food part. + +|FOOD_PARTS.Part_summary| |caseuniquekeycol| + + +.. _FOOD_PARTS.Description: + +Description +''''''''''' + +.. |FOOD_PARTS.Description_summary| replace:: + A description of the food part + +|FOOD_PARTS.Description_summary| |uniquenocase| |emptytext| |notnull| + + .. _OBS_PERIODS: OBS_PERIODS (Obsevervation Periods) diff --git a/doc/src/epilog.inc.m4 b/doc/src/epilog.inc.m4 index fbc9599..d07482d 100644 --- a/doc/src/epilog.inc.m4 +++ b/doc/src/epilog.inc.m4 @@ -338,6 +338,10 @@ sdb_generated_rst()dnl .. |EVENTS.Notes| replace:: :ref:`Notes ` +.. |FOOD_PARTS| replace:: :ref:`FOOD_PARTS ` +.. |FOOD_PARTS.Part| replace:: + :ref:`Part ` + .. |FOLLOWS| replace:: :ref:`FOLLOWS ` .. |FOLLOWS.FID| replace:: :ref:`FID ` -- 2.34.1