LP1811689 Stamping upgrade - truncate simple rec
authorBill Erickson <berickxx@gmail.com>
Fri, 8 Mar 2019 14:58:54 +0000 (09:58 -0500)
committerBill Erickson <berickxx@gmail.com>
Fri, 8 Mar 2019 14:58:54 +0000 (09:58 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1155.schema.reporter-simple-rec-truncate.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.reporter-simple-rec-truncate.sql [deleted file]

index 2d37ee2..5d4b323 100644 (file)
@@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1154', :eg_version); -- berick/mmorgan
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1155', :eg_version); -- berick/rogan
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1155.schema.reporter-simple-rec-truncate.sql b/Open-ILS/src/sql/Pg/upgrade/1155.schema.reporter-simple-rec-truncate.sql
new file mode 100644 (file)
index 0000000..d443931
--- /dev/null
@@ -0,0 +1,20 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1155', :eg_version);
+
+CREATE OR REPLACE FUNCTION reporter.enable_materialized_simple_record_trigger () RETURNS VOID AS $$
+
+    TRUNCATE TABLE reporter.materialized_simple_record;
+
+    INSERT INTO reporter.materialized_simple_record
+        (id,fingerprint,quality,tcn_source,tcn_value,title,author,publisher,pubdate,isbn,issn)
+        SELECT DISTINCT ON (id) * FROM reporter.old_super_simple_record;
+
+    CREATE TRIGGER bbb_simple_rec_trigger
+        AFTER INSERT OR UPDATE OR DELETE ON biblio.record_entry
+        FOR EACH ROW EXECUTE PROCEDURE reporter.simple_rec_trigger();
+
+$$ LANGUAGE SQL;
+
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.reporter-simple-rec-truncate.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.reporter-simple-rec-truncate.sql
deleted file mode 100644 (file)
index b64b22c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-BEGIN;
-
--- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
-
-CREATE OR REPLACE FUNCTION reporter.enable_materialized_simple_record_trigger () RETURNS VOID AS $$
-
-    TRUNCATE TABLE reporter.materialized_simple_record;
-
-    INSERT INTO reporter.materialized_simple_record
-        (id,fingerprint,quality,tcn_source,tcn_value,title,author,publisher,pubdate,isbn,issn)
-        SELECT DISTINCT ON (id) * FROM reporter.old_super_simple_record;
-
-    CREATE TRIGGER bbb_simple_rec_trigger
-        AFTER INSERT OR UPDATE OR DELETE ON biblio.record_entry
-        FOR EACH ROW EXECUTE PROCEDURE reporter.simple_rec_trigger();
-
-$$ LANGUAGE SQL;
-
-
-COMMIT;