From 94389ea3d51f9d255c3e2206aa6d744fb5d94822 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 13 May 2026 15:57:57 +0000 Subject: [PATCH] Create the NON_BREC_SIGHTING_SOURCES table This fixes errors reported by gen_comments.py when creating the database. --- db/schemas/sokwedb/tables/Makefile | 3 +- .../create/non_brec_sighting_sources.m4 | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 db/schemas/sokwedb/tables/create/non_brec_sighting_sources.m4 diff --git a/db/schemas/sokwedb/tables/Makefile b/db/schemas/sokwedb/tables/Makefile index d182209..a0e05c0 100644 --- a/db/schemas/sokwedb/tables/Makefile +++ b/db/schemas/sokwedb/tables/Makefile @@ -36,7 +36,8 @@ ORDER := biography_data \ species_present \ arrivals \ aggressions \ - aggression_event_log + aggression_event_log \ + non_brec_sighting_sources ## ## CAUTION: This Makefile is not designed to be run directly. It is normally ## invoked by another Makefile. diff --git a/db/schemas/sokwedb/tables/create/non_brec_sighting_sources.m4 b/db/schemas/sokwedb/tables/create/non_brec_sighting_sources.m4 new file mode 100644 index 0000000..0951f05 --- /dev/null +++ b/db/schemas/sokwedb/tables/create/non_brec_sighting_sources.m4 @@ -0,0 +1,38 @@ +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 + +CREATE TABLE non_brec_sighting_sources ( + key_column(`NON_BREC_SIGHTING_SOURCES', `ID', INTEGER) + ,source TEXT NOT NULL + REFERENCES sighting_records + ,date DATE NOT NULL + ,animid_column + ,commid TEXT NOT NULL + CONSTRAINT "CommID must be a COMM_IDS.CommID value" + REFERENCES comm_ids + ,notes TEXT NOT NULL + notonlyspaces_check(`Notes')); + +grant_priv(`NON_BREC_SIGHTING_SOURCES') -- 2.34.1