[open-ils-commits] r18578 - in trunk/Open-ILS/src/sql/Pg: . upgrade (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Nov 2 11:50:16 EDT 2010


Author: gmc
Date: 2010-11-02 11:50:13 -0400 (Tue, 02 Nov 2010)
New Revision: 18578

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0456.data.upc-lineitem-attr.sql
Modified:
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
   trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
add definition for UPC line item attribute

Useful for providers of audiovisual material that
don't have ISBNs.

Signed-off-by: Galen Charlton <gmc at esilibrary.com>


Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-11-02 13:05:27 UTC (rev 18577)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-11-02 15:50:13 UTC (rev 18578)
@@ -70,7 +70,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0455'); -- gmc
+INSERT INTO config.upgrade_log (version) VALUES ('0456'); -- gmc
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,

Modified: trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql	2010-11-02 13:05:27 UTC (rev 18577)
+++ trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql	2010-11-02 15:50:13 UTC (rev 18578)
@@ -18756,6 +18756,12 @@
 DROP TRIGGER IF EXISTS push_due_date_tgr ON action.circulation;
 CREATE TRIGGER push_due_date_tgr BEFORE INSERT OR UPDATE ON action.circulation FOR EACH ROW EXECUTE PROCEDURE action.push_circ_due_time();
 
+INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath, remove )
+SELECT 'upc', 'UPC', '//*[@tag="024" and @ind1="1"]/*[@code="a"]', $r$(?:-|\s.+$)$r$
+WHERE NOT EXISTS (
+    SELECT 1 FROM acq.lineitem_marc_attr_definition WHERE code = 'upc'
+);
+
 COMMIT;
 
 -- Some operations go outside of the transaction, because they may

Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql	2010-11-02 13:05:27 UTC (rev 18577)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql	2010-11-02 15:50:13 UTC (rev 18578)
@@ -598,6 +598,7 @@
 INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath ) VALUES ('pagination','Pagination','//*[@tag="300"]/*[@code="a"][1]');
 INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath, remove ) VALUES ('isbn','ISBN','//*[@tag="020"]/*[@code="a"]', $r$(?:-|\s.+$)$r$);
 INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath, remove ) VALUES ('issn','ISSN','//*[@tag="022"]/*[@code="a"]', $r$(?:-|\s.+$)$r$);
+INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath, remove ) VALUES ('upc', 'UPC', '//*[@tag="024" and @ind1="1"]/*[@code="a"]', $r$(?:-|\s.+$)$r$);
 INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath ) VALUES ('price','Price','//*[@tag="020" or @tag="022"]/*[@code="c"][1]');
 INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath ) VALUES ('identifier','Identifier','//*[@tag="001"]');
 INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath ) VALUES ('publisher','Publisher','//*[@tag="260"]/*[@code="b"][1]');

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0456.data.upc-lineitem-attr.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0456.data.upc-lineitem-attr.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0456.data.upc-lineitem-attr.sql	2010-11-02 15:50:13 UTC (rev 18578)
@@ -0,0 +1,11 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0456'); -- gmc
+
+INSERT INTO acq.lineitem_marc_attr_definition ( code, description, xpath, remove )
+SELECT 'upc', 'UPC', '//*[@tag="024" and @ind1="1"]/*[@code="a"]', $r$(?:-|\s.+$)$r$
+WHERE NOT EXISTS (
+    SELECT 1 FROM acq.lineitem_marc_attr_definition WHERE code = 'upc'
+);
+
+COMMIT;



More information about the open-ils-commits mailing list