[open-ils-commits] [GIT] Evergreen ILS branch master updated. d0afea424cedc206a46a315cd50d937d6cb7343d
Evergreen Git
git at git.evergreen-ils.org
Wed Sep 2 12:01:05 EDT 2015
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, master has been updated
via d0afea424cedc206a46a315cd50d937d6cb7343d (commit)
via 7c70e4c85875473387e2b1d8a684680748b45809 (commit)
via b2ba7022cb60a5066efe3e5a31b964100784a2a5 (commit)
from 6260738e9f3d4b47ef69cd1fa36b9f64d0997a71 (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 d0afea424cedc206a46a315cd50d937d6cb7343d
Author: Jason Stephenson <jstephenson at mvlc.org>
Date: Wed Sep 2 12:00:15 2015 -0400
LP#1484281: Stamping Upgrade Script.
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index d58b922..c5d3d44 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0940', :eg_version); -- miker/jboyer/csharp/dyrcona
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0941', :eg_version); -- yboston/dyrcona
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority.control_set_authority_field-remove-sf-e.sql b/Open-ILS/src/sql/Pg/upgrade/0941.data.authority.control_set_authority_field-remove-sf-e.sql
similarity index 64%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority.control_set_authority_field-remove-sf-e.sql
rename to Open-ILS/src/sql/Pg/upgrade/0941.data.authority.control_set_authority_field-remove-sf-e.sql
index b33c00b..c2c1224 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority.control_set_authority_field-remove-sf-e.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0941.data.authority.control_set_authority_field-remove-sf-e.sql
@@ -1,8 +1,6 @@
BEGIN;
-INSERT INTO config.upgrade_log (version) VALUES ('XXXX');
-
--- TODO: ask community if I should be warnign users that my code only fixes 100 & 110 auth tags for default (id=1) control set
+SELECT evergreen.upgrade_deps_block_check('0941', :eg_version);
UPDATE authority.control_set_authority_field SET sf_list = REGEXP_REPLACE( sf_list, 'e', '', 'i') WHERE tag = '100' AND control_set = 1 AND sf_list ILIKE '%e%';
commit 7c70e4c85875473387e2b1d8a684680748b45809
Author: Yamil Suarez <yamil at yamil.com>
Date: Wed Sep 2 11:20:23 2015 -0400
LP# 1484281 auth control config update release notes
Signed-off-by: Yamil Suarez <yamil at yamil.com>
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
diff --git a/docs/RELEASE_NOTES_NEXT/Cataloging/prevent_authority_propagation_delete.txt b/docs/RELEASE_NOTES_NEXT/Cataloging/prevent_authority_propagation_delete.txt
new file mode 100644
index 0000000..34018b1
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Cataloging/prevent_authority_propagation_delete.txt
@@ -0,0 +1,47 @@
+Preventing improper data deletion from subfield $e
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This release contains a fix for LP bug 1484281, "authority data may be
+deleted during propagation with current values of
+authority.control_set_authority_field."
+
+For more details see: https://bugs.launchpad.net/evergreen/+bug/1484281
+
+The related upgrade script from this release removes subfield $e
+in authority tags 100 and 110, but only from the Evergreen default
+"LoC" authority control set configuration. If your Evergreen system is
+set up with additional authority control sets besides the default
+"LoC" one, you will need to run the following pieces of SQL code.
+
+First verify that you have an additional control set besides the
+default of "LoC". Run the following SQL code and write down the ID
+number for your additional control set. The number will be an integer
+like 101.
+
+[source,sql]
+--------------------------------------------------------------------
+select *
+from authority.control_set
+where name != 'LoC'
+order by id
+--------------------------------------------------------------------
+
+In the following code you will need to change the two sections of
+"control_set = XYZ". Change the part labeled with the text "XYZ", with
+the ID number from the above query.
+
+If the above query displayed more than one additional authority
+control set, then you will need to run the code below once for each
+additional control set ID number.
+
+[source,sql]
+--------------------------------------------------------------------
+UPDATE authority.control_set_authority_field
+SET sf_list = REGEXP_REPLACE( sf_list, 'e', '', 'i')
+WHERE tag = '100' AND control_set = XYZ AND sf_list ILIKE '%e%';
+
+UPDATE authority.control_set_authority_field
+SET sf_list = REGEXP_REPLACE( sf_list, 'e', '', 'i')
+WHERE tag = '110' AND control_set = XYZ AND sf_list ILIKE '%e%';
+--------------------------------------------------------------------
+
commit b2ba7022cb60a5066efe3e5a31b964100784a2a5
Author: Yamil Suarez <yamil at yamil.com>
Date: Mon Aug 17 16:47:34 2015 -0400
LP# 1484281 auth control config update to prevent propagated data deletion
Remove subfield 'e' from authority.control_set_authority_field seed values
Removed from the auth tag 100 and 110, which should apply to bib tags
100,110,600,610,700,710
Added upgrade script, and pgTAP test.
How to test this patch
----------------------
[1] To test this bug you need 1 authority record and at least 1 bib record.
The auth record needs to have an auth 100 or 110 tag that has a subfield $e,
for example 100 $aDavis, Miles $ecomposer. (for the record, it is not good
cataloging practice to have $e in the auth record, but it can happen by mistake.)
The bib record needs to be have a matching bib 100 or 700 tag with the same
subfield $a and $e. In addition the matching bib tag has to be linked to the
authority record, i.e. the bib tag has to have a bib subfield $0 with the DB
id of the authority record.
[2] If you open up the authority record, in the authority MARC editor, and remove
the subfield $e; the subfield $e found in the bib record tag will be removed.
This is a mistake because normally bib record tags 100/110/700/710 do use subfield
$e, though the subfield $e should not be used in the auth record 100/110 tags.
[3] When this patch is applied, if a cataloger removes a subfield $e from an auth
100/110 tag, the deletion will not cascade to its linked bibs.
Signed-off-by: Yamil Suarez <yamil at yamil.com>
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
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 2532ba5..e8bf7c1 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -11425,9 +11425,9 @@ INSERT INTO authority.control_set_authority_field (id, control_set, main_entry,
INSERT INTO authority.control_set_authority_field (id, control_set, main_entry, tag, sf_list, display_sf_list, name) VALUES
-- Main entries
- (1, 1, NULL, '100', 'abcdefklmnopqrstvxyz', 'abcdefklmnopqrstvxyz',
+ (1, 1, NULL, '100', 'abcdfklmnopqrstvxyz', 'abcdefklmnopqrstvxyz',
oils_i18n_gettext('1','Heading -- Personal Name','acsaf','name')),
- (2, 1, NULL, '110', 'abcdefgklmnoprstvxyz', 'abcdefgklmnoprstvxyz',
+ (2, 1, NULL, '110', 'abcdfgklmnoprstvxyz', 'abcdefgklmnoprstvxyz',
oils_i18n_gettext('2','Heading -- Corporate Name','acsaf','name')),
(3, 1, NULL, '111', 'acdefgklnpqstvxyz', 'acdefgklnpqstvxyz',
oils_i18n_gettext('3','Heading -- Meeting Name','acsaf','name')),
diff --git a/Open-ILS/src/sql/Pg/t/regress/lp1465830_fix_auth_data_propagation_deletes.pg b/Open-ILS/src/sql/Pg/t/regress/lp1465830_fix_auth_data_propagation_deletes.pg
new file mode 100644
index 0000000..3f44c33
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/regress/lp1465830_fix_auth_data_propagation_deletes.pg
@@ -0,0 +1,22 @@
+-- Load the TAP functions.
+BEGIN;
+
+-- Plan the tests.
+SELECT plan(2);
+
+-- Run the tests.
+SELECT is(
+ (SELECT sf_list FROM authority.control_set_authority_field WHERE tag = '100') ,
+ 'abcdfklmnopqrstvxyz',
+ 'verify that subfield "e" has been removed'
+);
+
+SELECT is(
+ (SELECT sf_list FROM authority.control_set_authority_field WHERE tag = '110') ,
+ 'abcdfgklmnoprstvxyz',
+ 'verify that subfield "e" has been removed'
+);
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
\ No newline at end of file
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority.control_set_authority_field-remove-sf-e.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority.control_set_authority_field-remove-sf-e.sql
new file mode 100644
index 0000000..b33c00b
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.authority.control_set_authority_field-remove-sf-e.sql
@@ -0,0 +1,11 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('XXXX');
+
+-- TODO: ask community if I should be warnign users that my code only fixes 100 & 110 auth tags for default (id=1) control set
+
+UPDATE authority.control_set_authority_field SET sf_list = REGEXP_REPLACE( sf_list, 'e', '', 'i') WHERE tag = '100' AND control_set = 1 AND sf_list ILIKE '%e%';
+
+UPDATE authority.control_set_authority_field SET sf_list = REGEXP_REPLACE( sf_list, 'e', '', 'i') WHERE tag = '110' AND control_set = 1 AND sf_list ILIKE '%e%';
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 4 +-
.../lp1465830_fix_auth_data_propagation_deletes.pg | 22 +++++++++
...ity.control_set_authority_field-remove-sf-e.sql | 9 ++++
.../prevent_authority_propagation_delete.txt | 47 ++++++++++++++++++++
5 files changed, 81 insertions(+), 3 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/t/regress/lp1465830_fix_auth_data_propagation_deletes.pg
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0941.data.authority.control_set_authority_field-remove-sf-e.sql
create mode 100644 docs/RELEASE_NOTES_NEXT/Cataloging/prevent_authority_propagation_delete.txt
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list