create the unlogged table
authorChris Sharp <csharp@georgialibraries.org>
Thu, 19 May 2022 12:59:14 +0000 (08:59 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 15 Aug 2022 18:27:18 +0000 (14:27 -0400)
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.dym_delayed_reify.sql

index 5401162..9dc4b0c 100644 (file)
@@ -1,5 +1,26 @@
 BEGIN;
 
+-- INSERT-only table that catches updates to be reconciled
+CREATE UNLOGGED TABLE search.symspell_dictionary_updates (
+    transaction_id          BIGINT,
+    keyword_count           INT     NOT NULL DEFAULT 0,
+    title_count             INT     NOT NULL DEFAULT 0,
+    author_count            INT     NOT NULL DEFAULT 0,
+    subject_count           INT     NOT NULL DEFAULT 0,
+    series_count            INT     NOT NULL DEFAULT 0,
+    identifier_count        INT     NOT NULL DEFAULT 0,
+
+    prefix_key              TEXT    NOT NULL,
+
+    keyword_suggestions     TEXT[],
+    title_suggestions       TEXT[],
+    author_suggestions      TEXT[],
+    subject_suggestions     TEXT[],
+    series_suggestions      TEXT[],
+    identifier_suggestions  TEXT[]
+);
+CREATE INDEX symspell_dictionary_updates_tid_idx ON search.symspell_dictionary_updates (transaction_id);
+
 CREATE OR REPLACE FUNCTION search.disable_symspell_reification () RETURNS VOID AS $f$
     INSERT INTO config.internal_flag (name,enabled)
       VALUES ('ingest.disable_symspell_reification',TRUE)