LP#1768902 Stamping DB upgrade for Z39 UPC
authorBill Erickson <berickxx@gmail.com>
Fri, 24 Aug 2018 20:05:09 +0000 (16:05 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 24 Aug 2018 20:15:30 +0000 (16:15 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1120.data.add-upc-to-z3950.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.add-upc-to-z3950.sql [deleted file]

index e420874..7bf7874 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 ('1119', :eg_version); -- idjit/kmlussier
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1120', :eg_version); -- bshum/berick
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1120.data.add-upc-to-z3950.sql b/Open-ILS/src/sql/Pg/upgrade/1120.data.add-upc-to-z3950.sql
new file mode 100644 (file)
index 0000000..5c1b4fc
--- /dev/null
@@ -0,0 +1,15 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1120', :eg_version);
+
+--Only insert if the attributes are not already present
+
+INSERT INTO config.z3950_attr (source, name, label, code, format, truncation)
+SELECT 'oclc','upc','UPC','1007','6','0'
+WHERE NOT EXISTS (SELECT name FROM config.z3950_attr WHERE source = 'oclc' AND name = 'upc');
+
+INSERT INTO config.z3950_attr (source, name, label, code, format, truncation)
+SELECT 'loc','upc','UPC','1007','1','1'
+WHERE NOT EXISTS (SELECT name FROM config.z3950_attr WHERE source = 'loc' AND name = 'upc');
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.add-upc-to-z3950.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.add-upc-to-z3950.sql
deleted file mode 100644 (file)
index a44693e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-BEGIN;
-
---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
---Only insert if the attributes are not already present
-
-INSERT INTO config.z3950_attr (source, name, label, code, format, truncation)
-SELECT 'oclc','upc','UPC','1007','6','0'
-WHERE NOT EXISTS (SELECT name FROM config.z3950_attr WHERE source = 'oclc' AND name = 'upc');
-
-INSERT INTO config.z3950_attr (source, name, label, code, format, truncation)
-SELECT 'loc','upc','UPC','1007','1','1'
-WHERE NOT EXISTS (SELECT name FROM config.z3950_attr WHERE source = 'loc' AND name = 'upc');
-
-COMMIT;