LP#1764542 - Update older sites to MODS 3.3
authorChris Sharp <csharp@georgialibraries.org>
Mon, 4 Jun 2018 17:10:31 +0000 (13:10 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 19 Oct 2018 11:53:06 +0000 (07:53 -0400)
MODS 3.3 support was introduced in March 2009, but this
change was never included in an upgrade script.  Older
sites will need to apply this update to avoid scary
segmentation faults, and it shouls be harmless for newer
sites.

Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1764542-mods33-update.sql [new file with mode: 0644]

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1764542-mods33-update.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1764542-mods33-update.sql
new file mode 100644 (file)
index 0000000..106407b
--- /dev/null
@@ -0,0 +1,11 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+-- Thanks to Bill Ott for sharing his update
+UPDATE config.metabib_field SET xpath=regexp_replace(xpath,'mods32','mods33','g') WHERE xpath ~ 'mods32';
+UPDATE config.metabib_field SET format = 'mods33' WHERE format = 'mods32';
+ALTER TABLE config.metabib_field ALTER COLUMN format SET DEFAULT 'mods33'::text;
+
+COMMIT;
+