Stamped upgrade script for "lp 823496: do not fail to index personal names that have...
authorMike Rylander <mrylander@gmail.com>
Sat, 13 Aug 2011 01:07:41 +0000 (21:07 -0400)
committerMike Rylander <mrylander@gmail.com>
Sat, 13 Aug 2011 01:08:30 +0000 (21:08 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0599.data.fix_author_other_index.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.fix_author_other_index.sql [deleted file]

index 07a62ce..896eb6b 100644 (file)
@@ -86,7 +86,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');
 
     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 ('0598', :eg_version); -- berick/senator
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0599', :eg_version); -- miker/gmc
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0599.data.fix_author_other_index.sql b/Open-ILS/src/sql/Pg/upgrade/0599.data.fix_author_other_index.sql
new file mode 100644 (file)
index 0000000..745ac48
--- /dev/null
@@ -0,0 +1,28 @@
+-- Evergreen DB patch XXXX.fix_author_other_index.sql
+--
+-- Fix author|other index so that it doesn't exclude 700
+-- fields that contain relator values in the $e or $4.
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0599', :eg_version);
+
+UPDATE config.metabib_field 
+SET xpath = $$//mods32:mods/mods32:name[@type='personal' and not(mods32:role/mods32:roleTerm[text()='creator'])]$$
+WHERE field_class = 'author'
+AND name = 'other'
+AND xpath = $$//mods32:mods/mods32:name[@type='personal' and not(mods32:role)]$$
+AND format = 'mods32';
+
+-- To reindex the affected bibs, you can run something like this:
+--
+-- SELECT metabib.reingest_metabib_field_entries(record)
+-- FROM (
+--   SELECT DISTINCT record
+--   FROM metabib.real_full_rec
+--   WHERE tag IN ('600', '700', '720', '800')
+--   AND   subfield IN ('4', 'e')
+-- ) a;
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_author_other_index.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_author_other_index.sql
deleted file mode 100644 (file)
index 41d65f8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
--- Evergreen DB patch XXXX.fix_author_other_index.sql
---
--- Fix author|other index so that it doesn't exclude 700
--- fields that contain relator values in the $e or $4.
---
-BEGIN;
-
--- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-UPDATE config.metabib_field 
-SET xpath = $$//mods32:mods/mods32:name[@type='personal' and not(mods32:role/mods32:roleTerm[text()='creator'])]$$
-WHERE field_class = 'author'
-AND name = 'other'
-AND xpath = $$//mods32:mods/mods32:name[@type='personal' and not(mods32:role)]$$
-AND format = 'mods32';
-
--- To reindex the affected bibs, you can run something like this:
---
--- SELECT metabib.reingest_metabib_field_entries(record)
--- FROM (
---   SELECT DISTINCT record
---   FROM metabib.real_full_rec
---   WHERE tag IN ('600', '700', '720', '800')
---   AND   subfield IN ('4', 'e')
--- ) a;
-
-COMMIT;