[open-ils-commits] [GIT] Evergreen ILS branch rel_2_10 updated. c7388754c1662d2c52b3dc52ef3a1bf7573559b8

Evergreen Git git at git.evergreen-ils.org
Thu Apr 28 14:39:01 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_10 has been updated
       via  c7388754c1662d2c52b3dc52ef3a1bf7573559b8 (commit)
      from  3420c4733abc05b57e4f75a7d2e17d17a8de33e1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c7388754c1662d2c52b3dc52ef3a1bf7573559b8
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Thu Apr 28 13:15:42 2016 -0400

    2.10.1 to 2.10.2 schema upgrade script
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.10.1-2.10.2-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.10.1-2.10.2-upgrade-db.sql
new file mode 100644
index 0000000..535b1a8
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.10.1-2.10.2-upgrade-db.sql
@@ -0,0 +1,54 @@
+--Upgrade Script for 2.10.1 to 2.10.2
+\set eg_version '''2.10.2'''
+BEGIN;
+
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.10.2', :eg_version);
+
+SELECT evergreen.upgrade_deps_block_check('0976', :eg_version);
+
+ALTER TABLE action.usr_circ_history 
+    DROP CONSTRAINT IF EXISTS usr_circ_history_target_copy_fkey;
+
+CREATE TRIGGER action_usr_circ_history_target_copy_trig 
+    AFTER INSERT OR UPDATE ON action.usr_circ_history 
+    FOR EACH ROW EXECUTE PROCEDURE evergreen.fake_fkey_tgr('target_copy');
+
+SELECT evergreen.upgrade_deps_block_check('0977', :eg_version); -- Callender/Dyrcona/gmcharlt
+
+ALTER TABLE biblio.monograph_part DROP CONSTRAINT "record_label_unique";
+CREATE UNIQUE INDEX record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
+
+SELECT evergreen.upgrade_deps_block_check('0978', :eg_version);
+
+-- note: it is not necessary to explicitly drop the previous VARIADIC
+-- version of this stored procedure; create or replace function...
+-- suffices.
+CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_setting_batch( org_id INT, setting_names TEXT[] ) RETURNS SETOF actor.org_unit_setting AS $$
+DECLARE
+    setting RECORD;
+    setting_name TEXT;
+    cur_org INT;
+BEGIN
+    FOREACH setting_name IN ARRAY setting_names
+    LOOP
+        cur_org := org_id;
+        LOOP
+            SELECT INTO setting * FROM actor.org_unit_setting WHERE org_unit = cur_org AND name = setting_name;
+            IF FOUND THEN
+                RETURN NEXT setting;
+                EXIT;
+            END IF;
+            SELECT INTO cur_org parent_ou FROM actor.org_unit WHERE id = cur_org;
+            EXIT WHEN cur_org IS NULL;
+        END LOOP;
+    END LOOP;
+    RETURN;
+END;
+$$ LANGUAGE plpgsql STABLE;
+
+COMMENT ON FUNCTION actor.org_unit_ancestor_setting_batch( INT,  TEXT[] ) IS $$
+For each setting name passed, search "up" the org_unit tree until
+we find the first occurrence of an org_unit_setting with the given name.
+$$;
+
+COMMIT;

-----------------------------------------------------------------------

Summary of changes:
 .../version-upgrade/2.10.1-2.10.2-upgrade-db.sql   |   54 ++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/version-upgrade/2.10.1-2.10.2-upgrade-db.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list