From 1822f46e3debe8de6fc6efccd30414ee448df74d Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Thu, 14 May 2026 00:00:07 +0000 Subject: [PATCH] Create, document, and index FOOD_NAMES table --- db/schemas/codes/indexes/Makefile | 1 + db/schemas/codes/indexes/create/food_names.m4 | 29 ++++++++++++ db/schemas/codes/indexes/drop/food_names.m4 | 25 +++++++++++ db/schemas/codes/tables/Makefile | 1 + db/schemas/codes/tables/create/food_names.m4 | 29 ++++++++++++ doc/src/code_tables.m4 | 44 +++++++++++++++++++ doc/src/epilog.inc.m4 | 4 ++ 7 files changed, 133 insertions(+) create mode 100644 db/schemas/codes/indexes/create/food_names.m4 create mode 100644 db/schemas/codes/indexes/drop/food_names.m4 create mode 100644 db/schemas/codes/tables/create/food_names.m4 diff --git a/db/schemas/codes/indexes/Makefile b/db/schemas/codes/indexes/Makefile index 28b19e0..af7114a 100644 --- a/db/schemas/codes/indexes/Makefile +++ b/db/schemas/codes/indexes/Makefile @@ -25,6 +25,7 @@ ORDER := arrival_sources \ cycle_states \ dad_statuses \ food_parts \ + food_names \ obs_periods \ people \ role_codes \ diff --git a/db/schemas/codes/indexes/create/food_names.m4 b/db/schemas/codes/indexes/create/food_names.m4 new file mode 100644 index 0000000..2d88976 --- /dev/null +++ b/db/schemas/codes/indexes/create/food_names.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_names_uniquenocase ON food_names + (sdb_case_equivalence(name)); +CREATE UNIQUE INDEX IF NOT EXISTS + food_names_description_uniquenocase ON food_names + (sdb_case_equivalence(description)); diff --git a/db/schemas/codes/indexes/drop/food_names.m4 b/db/schemas/codes/indexes/drop/food_names.m4 new file mode 100644 index 0000000..3df9f50 --- /dev/null +++ b/db/schemas/codes/indexes/drop/food_names.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_names_name_uniquenocase; +DROP INDEX IF EXISTS food_names_description_uniquenocase; diff --git a/db/schemas/codes/tables/Makefile b/db/schemas/codes/tables/Makefile index 90611a5..a1cac64 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_names \ food_parts \ people \ obs_periods \ diff --git a/db/schemas/codes/tables/create/food_names.m4 b/db/schemas/codes/tables/create/food_names.m4 new file mode 100644 index 0000000..43da081 --- /dev/null +++ b/db/schemas/codes/tables/create/food_names.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_NAMES', `Name', `TEXT', ` + emptytext_check(`Name') + notonlyspaces_check(`Name')' +) diff --git a/doc/src/code_tables.m4 b/doc/src/code_tables.m4 index 5cd5737..100dbb4 100644 --- a/doc/src/code_tables.m4 +++ b/doc/src/code_tables.m4 @@ -555,6 +555,50 @@ Description |ENTRYTYPES.Description_summary| |emptytext| |notnull| +.. _FOOD_NAMES: + +FOOD_NAMES (FOOD sources) +------------------------- +.. |FOOD_NAMES_summary| replace:: + Each row represents a food source. + +|FOOD_NAMES_summary| +Some food sources have components. +The |FOOD_PARTS| table is used to designate a component of a food. + +.. _FOOD_NAMES_special_values: + +Special Values +`````````````` + +None. + + +Column Descriptions +``````````````````` + +.. _FOOD_NAMES.Name: + +Name +'''' + +.. |FOOD_NAMES.Name_summary| replace:: + A short sequence of characters which identify the food. + +|FOOD_NAMES.Name_summary| |caseuniquekeycol| + + +.. _FOOD_NAMES.Description: + +Description +''''''''''' + +.. |FOOD_NAMES.Description_summary| replace:: + A description of the kind of food. + +|FOOD_NAMES.Description_summary| |uniquenocase| |emptytext| |notnull| + + .. _FOOD_PARTS: FOOD_PARTS (Parts of Foods) diff --git a/doc/src/epilog.inc.m4 b/doc/src/epilog.inc.m4 index d07482d..e45732d 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_NAMES| replace:: :ref:`FOOD_NAMES ` +.. |FOOD_NAMES.Name| replace:: + :ref:`Food ` + .. |FOOD_PARTS| replace:: :ref:`FOOD_PARTS ` .. |FOOD_PARTS.Part| replace:: :ref:`Part ` -- 2.34.1