From 6dd34291652e229b817321c02d9eaee990330e8b Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Fri, 3 Oct 2025 20:46:44 +0000 Subject: [PATCH] Add ARRIVAL_SOURCES table; codes for arrvial/departure data source --- db/schemas/codes/indexes/Makefile | 3 +- .../codes/indexes/create/arrival_sources.m4 | 27 +++++++++++ .../codes/indexes/drop/arrival_sources.m4 | 24 ++++++++++ db/schemas/codes/tables/Makefile | 3 +- .../codes/tables/create/arrival_sources.m4 | 28 ++++++++++++ doc/src/code_tables.m4 | 45 +++++++++++++++++++ doc/src/epilog.inc.m4 | 7 +++ 7 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 db/schemas/codes/indexes/create/arrival_sources.m4 create mode 100644 db/schemas/codes/indexes/drop/arrival_sources.m4 create mode 100644 db/schemas/codes/tables/create/arrival_sources.m4 diff --git a/db/schemas/codes/indexes/Makefile b/db/schemas/codes/indexes/Makefile index 9a5f025..dc10fa6 100644 --- a/db/schemas/codes/indexes/Makefile +++ b/db/schemas/codes/indexes/Makefile @@ -19,7 +19,8 @@ # This determines the order in which the indexes are put into the database. # This is not really important but is needed for other types of db objects. -ORDER := comm_ids \ +ORDER := arrival_sources \ + comm_ids \ comm_membs_sources \ cycle_states \ obs_periods \ diff --git a/db/schemas/codes/indexes/create/arrival_sources.m4 b/db/schemas/codes/indexes/create/arrival_sources.m4 new file mode 100644 index 0000000..2318a61 --- /dev/null +++ b/db/schemas/codes/indexes/create/arrival_sources.m4 @@ -0,0 +1,27 @@ +dnl Copyright (C) 2025 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 arrival_sources_code_uniquenocase + ON arrival_sources + (sdb_case_equivalence(code)); + diff --git a/db/schemas/codes/indexes/drop/arrival_sources.m4 b/db/schemas/codes/indexes/drop/arrival_sources.m4 new file mode 100644 index 0000000..6acbc69 --- /dev/null +++ b/db/schemas/codes/indexes/drop/arrival_sources.m4 @@ -0,0 +1,24 @@ +dnl Copyright (C) 2025 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(`macros.m4')dnl + +DROP INDEX IF EXISTS arrival_sources_code_uniquenocase; diff --git a/db/schemas/codes/tables/Makefile b/db/schemas/codes/tables/Makefile index 58ceed2..141f36b 100644 --- a/db/schemas/codes/tables/Makefile +++ b/db/schemas/codes/tables/Makefile @@ -20,7 +20,8 @@ # This determines the order in which the tables are put into the database. # This is important because the tables containing foreign keys must be put # into the database after the tables they reference. -ORDER := certainties \ +ORDER := arrival_sources \ + certainties \ comm_ids \ comm_membs_sources \ cycle_states \ diff --git a/db/schemas/codes/tables/create/arrival_sources.m4 b/db/schemas/codes/tables/create/arrival_sources.m4 new file mode 100644 index 0000000..76d45f4 --- /dev/null +++ b/db/schemas/codes/tables/create/arrival_sources.m4 @@ -0,0 +1,28 @@ +dnl Copyright (C) 2025 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(`ARRIVAL_SOURCES', `Code', `TEXT', ` + emptytext_check(`Code')' +) diff --git a/doc/src/code_tables.m4 b/doc/src/code_tables.m4 index 67a90da..3fcbfeb 100644 --- a/doc/src/code_tables.m4 +++ b/doc/src/code_tables.m4 @@ -28,6 +28,51 @@ Code Tables =========== +.. _ARRIVAL_SOURCES: + +ARRIVAL_SOURCES (Sources of Arrival and departure data) +------------------------------------------------------- +.. |ARRIVAL_SOURCES_summary| replace:: + Each row represents source of data for arrival and departure + information. + +|ARRIVAL_SOURCES_summary| +This may be a document, a procedure, or a combination both. + +.. _ARRIVAL_SOURCES_special_values: + +Special Values +`````````````` + +None. + + +Column Descriptions +``````````````````` + +.. _ARRIVAL_SOURCES.Code: + +Code +'''' + +.. |ARRIVAL_SOURCES.Code_summary| replace:: + A short sequence of characters which identify how arrival and + departure information was determined. + +|ARRIVAL_SOURCES.Code_summary| |caseuniquekeycol| + + +.. _ARRIVAL_SOURCES.Description: + +Description +''''''''''' + +.. |ARRIVAL_SOURCES.Description_summary| replace:: + A description of the source of the arrival and departure information. + +|ARRIVAL_SOURCES.Description_summary| |emptytext| |notnull| + + .. _COMM_IDS: COMM_IDS (Community IDentifiers) diff --git a/doc/src/epilog.inc.m4 b/doc/src/epilog.inc.m4 index 404a140..cf90550 100644 --- a/doc/src/epilog.inc.m4 +++ b/doc/src/epilog.inc.m4 @@ -48,6 +48,13 @@ sdb_generated_rst()dnl the section heading and still get a link label with the name of the table or column. +.. |ARRIVAL_SOURCES| + replace:: :ref:`ARRIVAL_SOURCES ` +.. |ARRIVAL_SOURCES.Code| + replace:: :ref:`Code ` +.. |ARRIVAL_SOURCES.Description| + replace:: :ref:`Description ` + .. |BIOGRAPHY_DATA| replace:: :ref:`BIOGRAPHY_DATA ` .. |BIOGRAPHY_DATA.AnimID| replace:: -- 2.34.1