[open-ils-commits] [GIT] Evergreen ILS branch rel_2_3 updated. 70f19d8ecddd21953d978f255f8fd0bb172dc680
Evergreen Git
git at git.evergreen-ils.org
Sun Dec 23 15:42:30 EST 2012
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, rel_2_3 has been updated
via 70f19d8ecddd21953d978f255f8fd0bb172dc680 (commit)
via a4cbec6a24ea4f4dce22471c8563f00f85a956b4 (commit)
from aafe1c65d104c75453133ba97e662846a8549cd4 (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 70f19d8ecddd21953d978f255f8fd0bb172dc680
Author: Ben Shum <bshum at biblio.org>
Date: Sun Dec 23 15:38:43 2012 -0500
Stamping upgrade script for index corporate authors
Signed-off-by: Ben Shum <bshum at biblio.org>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 196e37f..db3e77e 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -87,7 +87,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 ('0748', :eg_version); -- dbwells/dbs
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0749', :eg_version); -- dbs/bshum
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.index_corporate_authors.sql b/Open-ILS/src/sql/Pg/upgrade/0749.data.index_corporate_authors.sql
similarity index 82%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.index_corporate_authors.sql
rename to Open-ILS/src/sql/Pg/upgrade/0749.data.index_corporate_authors.sql
index ff41992..a8621d0 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.index_corporate_authors.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0749.data.index_corporate_authors.sql
@@ -1,6 +1,11 @@
-- Use MARC relator codes (710 subfield 4) to index corporate authors, along
-- with the existing relator text (710 subfield e)
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0749', :eg_version);
+
UPDATE config.metabib_field
SET xpath = $$//mods32:mods/mods32:name[@type='corporate'
and (mods32:role/mods32:roleTerm[text()='creator']
@@ -16,3 +21,5 @@ SELECT metabib.reingest_metabib_field_entries(record, TRUE, TRUE, FALSE)
AND subfield = '4'
AND value IN ('cre', 'aut')
;
+
+COMMIT;
commit a4cbec6a24ea4f4dce22471c8563f00f85a956b4
Author: Dan Scott <dscott at laurentian.ca>
Date: Tue Oct 30 12:08:54 2012 -0400
Index corporate authors based on relator codes
The existing stock index for corporate authors only kicks in if the
710 subfield 'e' == 'creator', but relator codes (in subfield '4') are
by many accounts a preferred mode of identifying the relationship of an
added entry. Thus, add '4' == ('aut' or 'cre') to the criteria for
indexing a corporate author.
Signed-off-by: Dan Scott <dscott at laurentian.ca>
Signed-off-by: Ben Shum <bshum at biblio.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 b1fb85d..12ac691 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -123,7 +123,7 @@ INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath )
(6, 'title', 'proper', oils_i18n_gettext(6, 'Title Proper', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleNonfiling[mods32:title and not (@type)]$$ );
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, facet_xpath, facet_field ) VALUES
- (7, 'author', 'corporate', oils_i18n_gettext(7, 'Corporate Author', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:name[@type='corporate' and mods32:role/mods32:roleTerm[text()='creator']]$$, $$//*[local-name()='namePart']$$, TRUE ); -- /* to fool vim */;
+ (7, 'author', 'corporate', oils_i18n_gettext(7, 'Corporate Author', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:name[@type='corporate' and (mods32:role/mods32:roleTerm[text()='creator'] or mods32:role/mods32:roleTerm[text()='aut'] or mods32:role/mods32:roleTerm[text()='cre'])]$$, $$//*[local-name()='namePart']$$, TRUE ); -- /* to fool vim */;
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, facet_xpath, facet_field ) VALUES
(8, 'author', 'personal', oils_i18n_gettext(8, 'Personal Author', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:name[@type='personal' and mods32:role/mods32:roleTerm[text()='creator']]$$, $$//*[local-name()='namePart']$$, TRUE ); -- /* to fool vim */;
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, facet_xpath, facet_field ) VALUES
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.index_corporate_authors.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.index_corporate_authors.sql
new file mode 100644
index 0000000..ff41992
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.index_corporate_authors.sql
@@ -0,0 +1,18 @@
+-- Use MARC relator codes (710 subfield 4) to index corporate authors, along
+-- with the existing relator text (710 subfield e)
+
+UPDATE config.metabib_field
+ SET xpath = $$//mods32:mods/mods32:name[@type='corporate'
+ and (mods32:role/mods32:roleTerm[text()='creator']
+ or mods32:role/mods32:roleTerm[text()='aut']
+ or mods32:role/mods32:roleTerm[text()='cre']
+ )]$$
+ WHERE id = 7
+;
+
+SELECT metabib.reingest_metabib_field_entries(record, TRUE, TRUE, FALSE)
+ FROM metabib.full_rec
+ WHERE tag = '710'
+ AND subfield = '4'
+ AND value IN ('cre', 'aut')
+;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 2 +-
.../upgrade/0749.data.index_corporate_authors.sql | 25 ++++++++++++++++++++
3 files changed, 27 insertions(+), 2 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0749.data.index_corporate_authors.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list