[open-ils-commits] [GIT] Evergreen ILS branch rel_2_12 updated. 968581a09db18b61131c20e0d3bb412e545b4072

Evergreen Git git at git.evergreen-ils.org
Wed May 24 16:07:15 EDT 2017


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_12 has been updated
       via  968581a09db18b61131c20e0d3bb412e545b4072 (commit)
       via  00a0ae934a950b5ddf042a7dde17739058fbf650 (commit)
      from  e8b5078bffdf1661ce19ce4043c7e3ea5d4db03f (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 968581a09db18b61131c20e0d3bb412e545b4072
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed May 24 16:04:37 2017 -0400

    forward-port 2.11.4-2.11.5 schema update
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.11.4-2.11.5-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.11.4-2.11.5-upgrade-db.sql
new file mode 100644
index 0000000..6bedd4d
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.11.4-2.11.5-upgrade-db.sql
@@ -0,0 +1,145 @@
+--Upgrade Script for 2.11.4 to 2.11.5
+\set eg_version '''2.11.5'''
+BEGIN;
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.11.5', :eg_version);
+-- Evergreen DB patch XXXX.data.fix_long_overdue_perm.sql
+--
+-- Update permission 549 to have a "code" value that matches what
+-- the Perl code references
+--
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('1037', :eg_version); -- jeff
+
+-- For some time now, the database seed data / upgrade scripts have created
+-- a permission with id 549 and code COPY_STATUS_LONGOVERDUE.override, while
+-- the Perl code references a permission with code
+-- COPY_STATUS_LONG_OVERDUE.override
+--
+-- Below, we attempt to handle at least three possible database states:
+--
+-- 1) no corrective action has been taken, permission exists with id 549 and
+--    code COPY_STATUS_LONGOVERDUE.override
+--
+-- 2) permission with id 549 has already been updated to have code
+--    COPY_STATUS_LONG_OVERDUE.override
+--
+-- 3) new permission with unknown id and code COPY_STATUS_LONG_OVERDUE.override
+--    has been added, and potentially assigned to users/groups
+--
+-- In the case of 3, users and groups may have been assigned both perm id 549
+-- and the local permission of unknown id.
+--
+-- The desired end result is that we should have a permission.perm_list
+-- entry with id 549 and code COPY_STATUS_LONG_OVERDUE.override,
+-- any locally-created permission with that same code but a different id
+-- is deleted, and any users or groups that had been granted that locally-created
+-- permission (by id) have been granted permission id 549 if not already granted.
+--
+-- If for some reason the permission at id 549 has an unexpected value for "code",
+-- the end result of this upgrade script should be a no-op.
+
+-- grant permission 549 to any group that
+-- has a potentially locally-added perm
+-- with code COPY_STATUS_LONG_OVERDUE.override
+WITH new_grp_perms AS (
+SELECT grp, 549 AS perm, depth, grantable
+FROM permission.grp_perm_map pgpm
+JOIN permission.perm_list ppl ON ppl.id = pgpm.perm
+WHERE ppl.code = 'COPY_STATUS_LONG_OVERDUE.override'
+-- short circuit if perm id 549 exists and doesn't have the expected code
+AND EXISTS (SELECT 1 FROM permission.perm_list ppl WHERE ppl.id = 549 and ppl.code = 'COPY_STATUS_LONGOVERDUE.override')
+-- don't try to assign perm 549 if already assigned
+AND NOT EXISTS (SELECT 1 FROM permission.grp_perm_map pgpm2 WHERE pgpm2.grp = pgpm.grp AND pgpm2.perm = 549)
+)
+INSERT INTO permission.grp_perm_map
+(grp, perm, depth, grantable)
+SELECT grp, perm, depth, grantable
+FROM new_grp_perms;
+
+-- grant permission 549 to any user that
+-- has a potentially locally-added perm
+-- with code COPY_STATUS_LONG_OVERDUE.override
+WITH new_usr_perms AS (
+SELECT usr, 549 AS perm, depth, grantable
+FROM permission.usr_perm_map pupm
+JOIN permission.perm_list ppl ON ppl.id = pupm.perm
+WHERE ppl.code = 'COPY_STATUS_LONG_OVERDUE.override'
+-- short circuit if perm id 549 exists and doesn't have the expected code
+AND EXISTS (SELECT 1 FROM permission.perm_list ppl WHERE ppl.id = 549 and ppl.code = 'COPY_STATUS_LONGOVERDUE.override')
+-- don't try to assign perm 549 if already assigned
+AND NOT EXISTS (SELECT 1 FROM permission.usr_perm_map pupm2 WHERE pupm2.usr = pupm.usr AND pupm2.perm = 549)
+)
+INSERT INTO permission.usr_perm_map
+(usr, perm, depth, grantable)
+SELECT usr, perm, depth, grantable
+FROM new_usr_perms;
+
+-- delete any group assignments of the locally-added perm
+DELETE FROM permission.grp_perm_map
+WHERE perm = (SELECT id FROM permission.perm_list WHERE code = 'COPY_STATUS_LONG_OVERDUE.override' AND id <> 549)
+-- short circuit if perm id 549 exists and doesn't have the expected code
+AND EXISTS (SELECT 1 FROM permission.perm_list ppl WHERE ppl.id = 549 and ppl.code = 'COPY_STATUS_LONGOVERDUE.override');
+
+-- delete any user assignments of the locally-added perm
+DELETE FROM permission.usr_perm_map
+WHERE perm = (SELECT id FROM permission.perm_list WHERE code = 'COPY_STATUS_LONG_OVERDUE.override' AND id <> 549)
+-- short circuit if perm id 549 exists and doesn't have the expected code
+AND EXISTS (SELECT 1 FROM permission.perm_list ppl WHERE ppl.id = 549 and ppl.code = 'COPY_STATUS_LONGOVERDUE.override');
+
+-- delete the locally-added perm, if any
+DELETE FROM permission.perm_list
+WHERE code = 'COPY_STATUS_LONG_OVERDUE.override'
+AND id <> 549
+-- short circuit if perm id 549 exists and doesn't have the expected code
+AND EXISTS (SELECT 1 FROM permission.perm_list ppl WHERE ppl.id = 549 and ppl.code = 'COPY_STATUS_LONGOVERDUE.override');
+
+-- update perm id 549 to the correct code, if not already
+UPDATE permission.perm_list
+SET code = 'COPY_STATUS_LONG_OVERDUE.override'
+WHERE id = 549
+AND code = 'COPY_STATUS_LONGOVERDUE.override';
+
+
+SELECT evergreen.upgrade_deps_block_check('1039', :eg_version); -- jeffdavis/gmcharlt
+
+UPDATE config.org_unit_setting_type
+SET datatype = 'link', fm_class = 'vms'
+WHERE name = 'vandelay.default_match_set'
+AND   datatype = 'string'
+AND   fm_class IS NULL;
+
+\echo Existing vandelay.default_match_set that do not
+\echo correspond to match sets
+SELECT aou.shortname, aous.value
+FROM   actor.org_unit_setting aous
+JOIN   actor.org_unit aou ON (aou.id = aous.org_unit)
+WHERE  aous.name = 'vandelay.default_match_set'
+AND    (
+  value !~ '^"[0-9]+"$'
+  OR
+    oils_json_to_text(aous.value)::INT NOT IN (
+      SELECT id FROM vandelay.match_set
+    )
+);
+
+\echo And now deleting the bad values, as otherwise they
+\echo will break the Library Settings Editor.
+DELETE
+FROM actor.org_unit_setting aous
+WHERE  aous.name = 'vandelay.default_match_set'
+AND    (
+  value !~ '^"[0-9]+"$'
+  OR
+    oils_json_to_text(aous.value)::INT NOT IN (
+      SELECT id FROM vandelay.match_set
+    )
+);
+
+
+SELECT evergreen.upgrade_deps_block_check('1040', :eg_version);
+
+CREATE INDEX edi_message_remote_file_idx ON acq.edi_message (evergreen.lowercase(remote_file));
+
+COMMIT;

commit 00a0ae934a950b5ddf042a7dde17739058fbf650
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Wed Apr 19 17:37:56 2017 -0400

    Forward-port 2.11.4 upgrade script
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.11.3-2.11.4-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.11.3-2.11.4-upgrade-db.sql
new file mode 100644
index 0000000..340db09
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.11.3-2.11.4-upgrade-db.sql
@@ -0,0 +1,46 @@
+--Upgrade Script for 2.11.3 to 2.11.4
+\set eg_version '''2.11.4'''
+BEGIN;
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.11.4', :eg_version);
+
+SELECT evergreen.upgrade_deps_block_check('1030', :eg_version);
+
+CREATE OR REPLACE FUNCTION evergreen.oils_xslt_process(TEXT, TEXT) RETURNS TEXT AS $func$
+  use strict;
+
+  use XML::LibXSLT;
+  use XML::LibXML;
+
+  my $doc = shift;
+  my $xslt = shift;
+
+  # The following approach uses the older XML::LibXML 1.69 / XML::LibXSLT 1.68
+  # methods of parsing XML documents and stylesheets, in the hopes of broader
+  # compatibility with distributions
+  my $parser = $_SHARED{'_xslt_process'}{parsers}{xml} || XML::LibXML->new();
+
+  # Cache the XML parser, if we do not already have one
+  $_SHARED{'_xslt_process'}{parsers}{xml} = $parser
+    unless ($_SHARED{'_xslt_process'}{parsers}{xml});
+
+  my $xslt_parser = $_SHARED{'_xslt_process'}{parsers}{xslt} || XML::LibXSLT->new();
+
+  # Cache the XSLT processor, if we do not already have one
+  $_SHARED{'_xslt_process'}{parsers}{xslt} = $xslt_parser
+    unless ($_SHARED{'_xslt_process'}{parsers}{xslt});
+
+  my $stylesheet = $_SHARED{'_xslt_process'}{stylesheets}{$xslt} ||
+    $xslt_parser->parse_stylesheet( $parser->parse_string($xslt) );
+
+  $_SHARED{'_xslt_process'}{stylesheets}{$xslt} = $stylesheet
+    unless ($_SHARED{'_xslt_process'}{stylesheets}{$xslt});
+
+  return $stylesheet->output_as_chars(
+    $stylesheet->transform(
+      $parser->parse_string($doc)
+    )
+  );
+
+$func$ LANGUAGE 'plperlu' STRICT IMMUTABLE;
+
+COMMIT;

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

Summary of changes:
 ...upgrade-db.sql => 2.11.3-2.11.4-upgrade-db.sql} |    5 +-
 .../2.11.4-2.11.5-upgrade-db.sql}                  |   46 +++++++++++++++++++-
 2 files changed, 48 insertions(+), 3 deletions(-)
 copy Open-ILS/src/sql/Pg/version-upgrade/{2.10.10-2.10.11-upgrade-db.sql => 2.11.3-2.11.4-upgrade-db.sql} (90%)
 copy Open-ILS/src/sql/Pg/{upgrade/1037.data.fix_long_overdue_perm.sql => version-upgrade/2.11.4-2.11.5-upgrade-db.sql} (78%)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list