[open-ils-commits] r17029 - in tags/rel_1_6_0_7: . Open-ILS/src/perlmods/OpenILS Open-ILS/src/sql/Pg (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jul 23 13:38:19 EDT 2010


Author: miker
Date: 2010-07-23 13:38:16 -0400 (Fri, 23 Jul 2010)
New Revision: 17029

Added:
   tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/1.6.0.5-1.6.0.6-upgrade-db.sql
   tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/1.6.0.6-1.6.0.7-upgrade-db.sql
Modified:
   tags/rel_1_6_0_7/ChangeLog
   tags/rel_1_6_0_7/Open-ILS/src/perlmods/OpenILS/Application.pm
   tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/002.schema.config.sql
   tags/rel_1_6_0_7/README
Log:
version bumps and upgrade script for 1.6.0.7

Modified: tags/rel_1_6_0_7/ChangeLog
===================================================================
--- tags/rel_1_6_0_7/ChangeLog	2010-07-23 17:22:37 UTC (rev 17028)
+++ tags/rel_1_6_0_7/ChangeLog	2010-07-23 17:38:16 UTC (rev 17029)
@@ -1 +1,60 @@
-#ChangeLog
+2010-07-01  gmc
+
+	* backport r16838 from trunk
+	  
+	  bug #600021: fix lookup of FIFO holds OU setting
+	  
+	  Patch from Anoop Atre that fixes enabling FIFO
+	  holds via the circ.holds_fifo org unit setting.
+	  
+	  Signed-off-by: Galen Charlton <gmc at esilibrary.com>
+
+2010-07-07  miker
+
+	* add missing event definition required by vandelay authority
+	  import
+
+2010-07-09  miker
+
+	* Patch from James Fournie to address backdating timestamp format
+	  error
+
+2010-07-15  miker
+
+	* complete backporting fun for conify started around 1.6.0.4
+
+2010-07-16  erickson
+
+	* back-porting action trigger fixes 16953
+
+2010-07-20  miker
+
+	* backporting r16982: use the correct table and field, caught by
+	  Doug Kyle and reported via IRC
+
+	* Backport of r16987: Patch from John Craig providing a saner
+	  timestamp cleansing setup for backdated circs, 1.6 edition
+
+2010-07-21  miker
+
+	* index which /greatly/ speeds collection of pending active events
+
+2010-07-22  miker
+
+	* backport of r17007: retain the indicators on located uri 856
+	  merge during asset merge
+
+2010-07-22  gmc
+
+	* bug #608937: make barcode search from main patron search form
+	  case-insensitive
+	  
+	  Signed-off-by: Galen Charlton <gmc at esilibrary.com>
+
+2010-07-23  miker
+
+	* include null fields, via .toStoreItem(), when creating a
+	  permission map store item
+
+	* .: Tagging 1.6.0.7
+

Modified: tags/rel_1_6_0_7/Open-ILS/src/perlmods/OpenILS/Application.pm
===================================================================
--- tags/rel_1_6_0_7/Open-ILS/src/perlmods/OpenILS/Application.pm	2010-07-23 17:22:37 UTC (rev 17028)
+++ tags/rel_1_6_0_7/Open-ILS/src/perlmods/OpenILS/Application.pm	2010-07-23 17:38:16 UTC (rev 17029)
@@ -5,7 +5,7 @@
 
 sub ils_version {
     # version format is "x-y-z-p", for example "1-2-1-0" for Evergreen 1.2.1.0
-    return "1-5";
+    return "1-6-0-7";
 }
 
 __PACKAGE__->register_method(

Modified: tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-07-23 17:22:37 UTC (rev 17028)
+++ tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-07-23 17:38:16 UTC (rev 17029)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2004-2008  Georgia Public Library Service
- * Copyright (C) 2008  Equinox Software, Inc.
+ * Copyright (C) 2008-2010  Equinox Software, Inc.
  * Mike Rylander <miker at esilibrary.com>
  *
  * This program is free software; you can redistribute it and/or
@@ -51,7 +51,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('1.6.0.4'); -- dbs
+INSERT INTO config.upgrade_log (version) VALUES ('1.6.0.7'); -- miker
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,

Added: tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/1.6.0.5-1.6.0.6-upgrade-db.sql
===================================================================
--- tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/1.6.0.5-1.6.0.6-upgrade-db.sql	                        (rev 0)
+++ tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/1.6.0.5-1.6.0.6-upgrade-db.sql	2010-07-23 17:38:16 UTC (rev 17029)
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2010  Equinox Software, Inc.
+ * Mike Rylander <miker at esilibrary.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+BEGIN;
+
+INSERT INTO config.upgrade_log(version) VALUES ('1.6.0.6');
+
+COMMIT;

Added: tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/1.6.0.6-1.6.0.7-upgrade-db.sql
===================================================================
--- tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/1.6.0.6-1.6.0.7-upgrade-db.sql	                        (rev 0)
+++ tags/rel_1_6_0_7/Open-ILS/src/sql/Pg/1.6.0.6-1.6.0.7-upgrade-db.sql	2010-07-23 17:38:16 UTC (rev 17029)
@@ -0,0 +1,175 @@
+/*
+ * Copyright (C) 2010  Equinox Software, Inc.
+ * Mike Rylander <miker at esilibrary.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+BEGIN;
+
+INSERT INTO config.upgrade_log(version) VALUES ('1.6.0.7');
+
+CREATE INDEX atev_target_def_idx ON action_trigger.event (target,event_def);
+
+CREATE OR REPLACE FUNCTION asset.merge_record_assets( target_record BIGINT, source_record BIGINT ) RETURNS INT AS $func$
+DECLARE
+    moved_objects INT := 0;
+    source_cn     asset.call_number%ROWTYPE;
+    target_cn     asset.call_number%ROWTYPE;
+    metarec       metabib.metarecord%ROWTYPE;
+    hold          action.hold_request%ROWTYPE;
+    ser_rec       serial.record_entry%ROWTYPE;
+    uri_count     INT := 0;
+    counter       INT := 0;
+    uri_datafield TEXT;
+    uri_text      TEXT := '';
+BEGIN
+
+    -- move any 856 entries on records that have at least one MARC-mapped URI entry
+    SELECT  INTO uri_count COUNT(*)
+      FROM  asset.uri_call_number_map m
+            JOIN asset.call_number cn ON (m.call_number = cn.id)
+      WHERE cn.record = source_record;
+
+    IF uri_count > 0 THEN
+
+        SELECT  COUNT(*) INTO counter
+          FROM  xpath_table(
+                    'id',
+                    'marc',
+                    'biblio.record_entry',
+                    '//*[@tag="856"]',
+                    'id=' || source_record
+                ) as t(i int,c text);
+
+        FOR i IN 1 .. counter LOOP
+            SELECT  '<datafield xmlns="http://www.loc.gov/MARC21/slim"' ||
+            ' tag="856"' ||
+            ' ind1="' || FIRST(ind1) || '"'  ||
+            ' ind2="' || FIRST(ind2) || '">' ||
+                        array_to_string(
+                            array_accum(
+                                '<subfield code="' || subfield || '">' ||
+                                regexp_replace(
+                                    regexp_replace(
+                                        regexp_replace(data,'&','&amp;','g'),
+                                        '>', '&gt;', 'g'
+                                    ),
+                                    '<', '&lt;', 'g'
+                                ) || '</subfield>'
+                            ), ''
+                        ) || '</datafield>' INTO uri_datafield
+              FROM  xpath_table(
+                        'id',
+                        'marc',
+                        'biblio.record_entry',
+                        '//*[@tag="856"][position()=' || i || ']/@ind1|' ||
+                        '//*[@tag="856"][position()=' || i || ']/@ind2|' ||
+                        '//*[@tag="856"][position()=' || i || ']/*/@code|' ||
+                        '//*[@tag="856"][position()=' || i || ']/*[@code]',
+                        'id=' || source_record
+                    ) as t(id int,ind1 text, ind2 text,subfield text,data text);
+
+            uri_text := uri_text || uri_datafield;
+        END LOOP;
+
+        IF uri_text <> '' THEN
+            UPDATE  biblio.record_entry
+              SET   marc = regexp_replace(marc,'(</[^>]*record>)', uri_text || E'\\1')
+              WHERE id = target_record;
+        END IF;
+
+    END IF;
+
+    -- Find and move metarecords to the target record
+    SELECT  INTO metarec *
+      FROM  metabib.metarecord
+      WHERE master_record = source_record;
+
+    IF FOUND THEN
+        UPDATE  metabib.metarecord
+          SET   master_record = target_record,
+            mods = NULL
+          WHERE id = metarec.id;
+
+        moved_objects := moved_objects + 1;
+    END IF;
+
+    -- Find call numbers attached to the source ...
+    FOR source_cn IN SELECT * FROM asset.call_number WHERE record = source_record LOOP
+
+        SELECT  INTO target_cn *
+          FROM  asset.call_number
+          WHERE label = source_cn.label
+            AND owning_lib = source_cn.owning_lib
+            AND record = target_record;
+
+        -- ... and if there's a conflicting one on the target ...
+        IF FOUND THEN
+
+            -- ... move the copies to that, and ...
+            UPDATE  asset.copy
+              SET   call_number = target_cn.id
+              WHERE call_number = source_cn.id;
+
+            -- ... move V holds to the move-target call number
+            FOR hold IN SELECT * FROM action.hold_request WHERE target = source_cn.id AND hold_type = 'V' LOOP
+
+                UPDATE  action.hold_request
+                  SET   target = target_cn.id
+                  WHERE id = hold.id;
+
+                moved_objects := moved_objects + 1;
+            END LOOP;
+
+        -- ... if not ...
+        ELSE
+            -- ... just move the call number to the target record
+            UPDATE  asset.call_number
+              SET   record = target_record
+              WHERE id = source_cn.id;
+        END IF;
+
+        moved_objects := moved_objects + 1;
+    END LOOP;
+
+    -- Find T holds targeting the source record ...
+    FOR hold IN SELECT * FROM action.hold_request WHERE target = source_record AND hold_type = 'T' LOOP
+
+        -- ... and move them to the target record
+        UPDATE  action.hold_request
+          SET   target = target_record
+          WHERE id = hold.id;
+
+        moved_objects := moved_objects + 1;
+    END LOOP;
+
+    -- Find serial records targeting the source record ...
+    FOR ser_rec IN SELECT * FROM serial.record_entry WHERE record = source_record LOOP
+        -- ... and move them to the target record
+        UPDATE  serial.record_entry
+          SET   record = target_record
+          WHERE id = ser_rec.id;
+
+        moved_objects := moved_objects + 1;
+    END LOOP;
+
+    -- Finally, "delete" the source record
+    DELETE FROM biblio.record_entry WHERE id = source_record;
+
+    -- That's all, folks!
+    RETURN moved_objects;
+END;
+$func$ LANGUAGE plpgsql;
+
+
+COMMIT;

Modified: tags/rel_1_6_0_7/README
===================================================================
--- tags/rel_1_6_0_7/README	2010-07-23 17:22:37 UTC (rev 17028)
+++ tags/rel_1_6_0_7/README	2010-07-23 17:38:16 UTC (rev 17029)
@@ -5,7 +5,7 @@
 Evergreen has a number of prerequisite packages that must be installed
 before you can successfully configure, compile, and install Evergreen.
 
-1. Begin by installing the most recent version of OpenSRF (1.1 or later).
+1. Begin by installing the most recent version of OpenSRF (1.2 or later).
 You can download OpenSRF releases from
 http://evergreen-ils.org/downloads
 
@@ -40,7 +40,7 @@
 Once you have configured and compiled Evergreen, issue the following
 command as the root user to install Evergreen:
 
-make STAFF_CLIENT_BUILD_ID=rel_1_6_0_0 install
+make STAFF_CLIENT_BUILD_ID=rel_1_6_0_7 install
 
 This will install Evergreen, including example configuration files in
 /openils/conf/ that you can use as templates for your own configuration files.



More information about the open-ils-commits mailing list