From 0e9ae4e247923ee56bb038c4380d928b70f75014 Mon Sep 17 00:00:00 2001 From: Ben Shum Date: Thu, 3 May 2018 12:24:44 -0500 Subject: [PATCH] LP#1768902: Add UPC to z3950 search for OCLC and LOC Based on settings provided by Jane Sandberg, add the UPC as a search attribute definition for OCLC and LOC z3950 targets. Signed-off-by: Ben Shum Signed-off-by: Garry Collum Signed-off-by: Bill Erickson --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 4 ++++ .../src/sql/Pg/upgrade/XXXX.data.add-upc-to-z3950.sql | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.add-upc-to-z3950.sql diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 46e9bf6374..aa0f1636fc 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -618,6 +618,8 @@ INSERT INTO config.z3950_attr (id, source, name, label, code, format) VALUES (8, 'loc', 'pubdate', oils_i18n_gettext(8, 'Publication Date', 'cza', 'label'), 31, 1); INSERT INTO config.z3950_attr (id, source, name, label, code, format) VALUES (9, 'loc', 'item_type', oils_i18n_gettext(9, 'Item Type', 'cza', 'label'), 1001, 1); +INSERT INTO config.z3950_attr (id, source, name, label, code, format) + VALUES (19, 'loc', 'upc', oils_i18n_gettext(19, 'UPC', 'cza', 'label'), 1007, 1); UPDATE config.z3950_attr SET truncation = 1 WHERE source = 'loc'; @@ -639,6 +641,8 @@ INSERT INTO config.z3950_attr (id, source, name, label, code, format) VALUES (17, 'oclc', 'pubdate', oils_i18n_gettext(17, 'Publication Date', 'cza', 'label'), 31, 1); INSERT INTO config.z3950_attr (id, source, name, label, code, format) VALUES (18, 'oclc', 'item_type', oils_i18n_gettext(18, 'Item Type', 'cza', 'label'), 1001, 1); +INSERT INTO config.z3950_attr (id, source, name, label, code, format) + VALUES (20, 'oclc', 'upc', oils_i18n_gettext(20, 'UPC', 'cza', 'label'), 1007, 6); SELECT SETVAL('config.z3950_attr_id_seq'::TEXT, 100); 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 new file mode 100644 index 0000000000..a44693ead7 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.add-upc-to-z3950.sql @@ -0,0 +1,15 @@ +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; -- 2.11.0