[open-ils-commits] [GIT] Evergreen ILS branch master updated. d8e092ac014beee99ca75224a7524d3c0f41690b

Evergreen Git git at git.evergreen-ils.org
Wed May 2 01:47:01 EDT 2018


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  d8e092ac014beee99ca75224a7524d3c0f41690b (commit)
       via  159cf3c2dd9bd465f7cab8cd44e0841bf8006343 (commit)
      from  b48f10271bbd493b08e38766007afd708961a09b (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 d8e092ac014beee99ca75224a7524d3c0f41690b
Author: Ben Shum <ben at evergreener.net>
Date:   Wed May 2 00:45:14 2018 -0500

    Revert "LP#1387722: Update MARC leader when deleting a record"
    
    This reverts commit 7dfcdd814f60a20c1b8b4522e69c0a27c23123b5.

diff --git a/Open-ILS/src/sql/Pg/010.schema.biblio.sql b/Open-ILS/src/sql/Pg/010.schema.biblio.sql
index 7ce4490..857307e 100644
--- a/Open-ILS/src/sql/Pg/010.schema.biblio.sql
+++ b/Open-ILS/src/sql/Pg/010.schema.biblio.sql
@@ -123,36 +123,4 @@ $$ LANGUAGE PLPGSQL;
 
 CREATE TRIGGER norm_sort_label BEFORE INSERT OR UPDATE ON biblio.monograph_part FOR EACH ROW EXECUTE PROCEDURE biblio.normalize_biblio_monograph_part_sortkey();
 
-CREATE OR REPLACE FUNCTION biblio.set_record_status_in_leader() RETURNS TRIGGER AS $func$
-use strict;
-use MARC::Record;
-use MARC::Field;
-use MARC::File::XML (BinaryEncoding => 'utf8');
-use Unicode::Normalize;
-
-my $old_marc = MARC::Record->new_from_xml($_TD->{new}{marc});
-my $old_leader = $old_marc->leader();
-my $old_status = substr($old_leader,5,1);
-
-my $status;
-if ($_TD->{event} eq 'INSERT') {$status = 'n';}
-elsif ($_TD->{event} eq 'UPDATE' && $_TD->{new}{deleted} eq 't') {$status = 'd';}
-elsif ($_TD->{event} eq 'UPDATE' && $_TD->{new}{deleted} eq 'f') {$status = 'c';}
-
-if ($old_status ne $status) {
-    my $marc = MARC::Record->new_from_xml($_TD->{new}{marc});
-    my $leader = $marc->leader();
-    substr($leader,5,1) = $status;
-    $marc->leader($leader);
-    my $marc_xml = $marc->as_xml_record();
-    $marc_xml = NFC($marc_xml);  
-    $_TD->{new}{marc} = $marc_xml;
-} 
-
-return "MODIFY";
-
-$func$ LANGUAGE PLPERLU;
-
-CREATE TRIGGER set_record_status_in_leader BEFORE INSERT OR UPDATE ON biblio.record_entry FOR EACH ROW EXECUTE PROCEDURE biblio.set_record_status_in_leader();
-
 COMMIT;
diff --git a/Open-ILS/src/sql/Pg/t/lp1387722_record_leader_updates.pg b/Open-ILS/src/sql/Pg/t/lp1387722_record_leader_updates.pg
deleted file mode 100644
index ff845ce..0000000
--- a/Open-ILS/src/sql/Pg/t/lp1387722_record_leader_updates.pg
+++ /dev/null
@@ -1,39 +0,0 @@
-BEGIN;
-
-SELECT plan(4);
-
-----------------------------------
--- Setup Test environment and data
-----------------------------------
-
--- create bib 70,000
-INSERT into biblio.record_entry (id, marc, last_xact_id)
-  VALUES (70000, 
-  $$
-  <record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"><leader>00934|jm a2200241 a 4500</leader><controlfield tag="001">03-0003745</controlfield><controlfield tag="005">19991118131708.0</controlfield><controlfield tag="008">971016n nyuuuu eng </controlfield><datafield tag="050" ind1=" " ind2=" "><subfield code="a">4539</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Bart&#xF3;k, B&#xE9;la,</subfield><subfield code="d">1881-1945.</subfield></datafield><datafield tag="240" ind1=" " ind2=" "><subfield code="t">Concertos,</subfield><subfield code="m">piano,</subfield><subfield code="n">no. 1,</subfield><subfield code="n">Sz. 83</subfield><subfield code="f">(1926) </subfield><subfield code="a">Concertos,</subfield><subfield code="m">piano,</subfield><subfield code="n">no. 1,</subfield><subfie
 ld code="n">Sz. 83,</subfield><subfield code="n">(1926)</subfield></datafield><datafield tag="245" ind1=" " ind2=" "><subfield code="a">Piano concerto no. 1 (1926) ; Rhapsody, op. 1 (1904)</subfield></datafield><datafield tag="260" ind1=" " ind2=" "><subfield code="a">New York, NY :</subfield><subfield code="b">Vox</subfield></datafield></record>
-  $$,
-  'PGTAP'
-  );
-
------------------------------------
--- Test biblio.set_record_status_in_leader()
------------------------------------
-
--- initially the status is undefined so now it should be 'n'
-SELECT is((SELECT SUBSTR(ARRAY_TO_STRING(oils_xpath('//*[local-name()="leader"]/text()',marc),''),6,1) FROM biblio.record_entry WHERE id = 70000), 'n', 'Record is marked new.');
-
--- check to see if it sets to 'c' correctly upon editing
-UPDATE biblio.record_entry SET marc = REPLACE(marc,'piano','dydraulophone') WHERE id = 70000;
-SELECT is((SELECT SUBSTR(ARRAY_TO_STRING(oils_xpath('//*[local-name()="leader"]/text()',marc),''),6,1) FROM biblio.record_entry WHERE id = 70000), 'c', 'Record is marked updated.');
-
--- see if the record correctly marks as deleted 'd'
-UPDATE biblio.record_entry SET deleted = TRUE WHERE id = 70000;
-SELECT is((SELECT SUBSTR(ARRAY_TO_STRING(oils_xpath('//*[local-name()="leader"]/text()',marc),''),6,1) FROM biblio.record_entry WHERE id = 70000), 'd', 'Record is marked deleted.');
-
--- see if the record is correctly set to 'c' when undeleted
-UPDATE biblio.record_entry SET deleted = FALSE WHERE id = 70000;
-SELECT is((SELECT SUBSTR(ARRAY_TO_STRING(oils_xpath('//*[local-name()="leader"]/text()',marc),''),6,1) FROM biblio.record_entry WHERE id = 70000), 'c', 'Record is marked updated.');
-
-SELECT * FROM finish();
-
-ROLLBACK;
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.set_record_status_in_leader_trigger.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.set_record_status_in_leader_trigger.sql
deleted file mode 100644
index d7f7206..0000000
--- a/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.set_record_status_in_leader_trigger.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version);
-
-CREATE OR REPLACE FUNCTION biblio.set_record_status_in_leader() RETURNS TRIGGER AS $func$
-use strict;
-use MARC::Record;
-use MARC::Field;
-use MARC::File::XML (BinaryEncoding => 'utf8');
-use Unicode::Normalize;
-
-my $old_marc = MARC::Record->new_from_xml($_TD->{new}{marc});
-my $old_leader = $old_marc->leader();
-my $old_status = substr($old_leader,5,1);
-
-my $status;
-if ($_TD->{event} eq 'INSERT') {$status = 'n';}
-elsif ($_TD->{event} eq 'UPDATE' && $_TD->{new}{deleted} eq 't') {$status = 'd';}
-elsif ($_TD->{event} eq 'UPDATE' && $_TD->{new}{deleted} eq 'f') {$status = 'c';}
-
-if ($old_status ne $status) {
-    my $marc = MARC::Record->new_from_xml($_TD->{new}{marc});
-    my $leader = $marc->leader();
-    substr($leader,5,1) = $status;
-    $marc->leader($leader);
-    my $marc_xml = $marc->as_xml_record();
-    $marc_xml = NFC($marc_xml);  
-    $_TD->{new}{marc} = $marc_xml;
-} 
-
-return "MODIFY";
-
-$func$ LANGUAGE PLPERLU;
-
-CREATE TRIGGER set_record_status_in_leader BEFORE INSERT OR UPDATE ON biblio.record_entry FOR EACH ROW EXECUTE PROCEDURE biblio.set_record_status_in_leader();
-
-COMMIT;
diff --git a/docs/RELEASE_NOTES_NEXT/Cataloging/leader_updated_on_delete_creation_update.adoc b/docs/RELEASE_NOTES_NEXT/Cataloging/leader_updated_on_delete_creation_update.adoc
deleted file mode 100644
index 527ef7c..0000000
--- a/docs/RELEASE_NOTES_NEXT/Cataloging/leader_updated_on_delete_creation_update.adoc
+++ /dev/null
@@ -1,7 +0,0 @@
-MARC Leader Updated on Bib Deletion, Creation and Update
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-There is now a trigger in place on the bibliographic record table that 
-will update the Leader/05 when a new record is inserted, when a record 
-is updated or deleted.  On insert (created new or imported) it will be 
-marked as 'n' for new, on update (including undeletion) it will be 
-marked 'c' for modified and on deletion will be marked 'd' for deleted.

commit 159cf3c2dd9bd465f7cab8cd44e0841bf8006343
Author: Ben Shum <ben at evergreener.net>
Date:   Wed May 2 00:45:12 2018 -0500

    Revert "LP#1387722: Stamping upgrade script"
    
    This reverts commit f9a4f76fc4ea4cac75687eabf4208cce234b3f05.

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 465dbc9..c05350e 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,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 ('1110', :eg_version); --rhamby/bshum
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1109', :eg_version); --dbwells/kmlussier
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1110.schema.set_record_status_in_leader_trigger.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.set_record_status_in_leader_trigger.sql
similarity index 94%
rename from Open-ILS/src/sql/Pg/upgrade/1110.schema.set_record_status_in_leader_trigger.sql
rename to Open-ILS/src/sql/Pg/upgrade/xxxx.schema.set_record_status_in_leader_trigger.sql
index 02b4fed..d7f7206 100644
--- a/Open-ILS/src/sql/Pg/upgrade/1110.schema.set_record_status_in_leader_trigger.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.set_record_status_in_leader_trigger.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('1110', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version);
 
 CREATE OR REPLACE FUNCTION biblio.set_record_status_in_leader() RETURNS TRIGGER AS $func$
 use strict;

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

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/010.schema.biblio.sql          |   32 ----------------
 .../sql/Pg/t/lp1387722_record_leader_updates.pg    |   39 --------------------
 ....schema.set_record_status_in_leader_trigger.sql |   37 -------------------
 .../leader_updated_on_delete_creation_update.adoc  |    7 ----
 5 files changed, 1 insertions(+), 116 deletions(-)
 delete mode 100644 Open-ILS/src/sql/Pg/t/lp1387722_record_leader_updates.pg
 delete mode 100644 Open-ILS/src/sql/Pg/upgrade/1110.schema.set_record_status_in_leader_trigger.sql
 delete mode 100644 docs/RELEASE_NOTES_NEXT/Cataloging/leader_updated_on_delete_creation_update.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list