Revert "LP#1387722: Stamping upgrade script"
authorBen Shum <ben@evergreener.net>
Wed, 2 May 2018 05:45:12 +0000 (00:45 -0500)
committerBen Shum <ben@evergreener.net>
Wed, 2 May 2018 05:45:12 +0000 (00:45 -0500)
This reverts commit f9a4f76fc4ea4cac75687eabf4208cce234b3f05.

Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1110.schema.set_record_status_in_leader_trigger.sql [deleted file]
Open-ILS/src/sql/Pg/upgrade/xxxx.schema.set_record_status_in_leader_trigger.sql [new file with mode: 0644]

index 465dbc9..c05350e 100644 (file)
@@ -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/1110.schema.set_record_status_in_leader_trigger.sql
deleted file mode 100644 (file)
index 02b4fed..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('1110', :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/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
new file mode 100644 (file)
index 0000000..d7f7206
--- /dev/null
@@ -0,0 +1,37 @@
+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;