[open-ils-commits] r866 - conifer/branches/rel_1_6_0/tools/daily-scripts (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 13 12:03:04 EDT 2010
Author: dbs
Date: 2010-04-13 12:03:01 -0400 (Tue, 13 Apr 2010)
New Revision: 866
Added:
conifer/branches/rel_1_6_0/tools/daily-scripts/OSUL-patrons-lang-prefs.sql
conifer/branches/rel_1_6_0/tools/daily-scripts/update_indexes_for_ampersand_equivalency.sql
Log:
Add SQL scripts for nightly cron jobs:
* OSUL-patrons-lang-prefs.sql - ensures a stat cat for language preference is set for every user in OSUL
* update_indexes_for_ampersand_equivalency.sql - adds "and" to index where value is "&"
Added: conifer/branches/rel_1_6_0/tools/daily-scripts/OSUL-patrons-lang-prefs.sql
===================================================================
--- conifer/branches/rel_1_6_0/tools/daily-scripts/OSUL-patrons-lang-prefs.sql (rev 0)
+++ conifer/branches/rel_1_6_0/tools/daily-scripts/OSUL-patrons-lang-prefs.sql 2010-04-13 16:03:01 UTC (rev 866)
@@ -0,0 +1,10 @@
+-- Ensure that we have a stat cat entry for language preference for OSUL users
+-- NOTE: We should cut over to usr_settings at some point
+INSERT INTO actor.stat_cat_entry_usr_map (stat_cat_entry, stat_cat, target_usr)
+ SELECT 'English', 2, au.id
+ FROM actor.usr au
+ WHERE au.id NOT IN (
+ SELECT target_usr
+ FROM actor.stat_cat_entry_usr_map
+ ) AND home_ou = 103
+;
Added: conifer/branches/rel_1_6_0/tools/daily-scripts/update_indexes_for_ampersand_equivalency.sql
===================================================================
--- conifer/branches/rel_1_6_0/tools/daily-scripts/update_indexes_for_ampersand_equivalency.sql (rev 0)
+++ conifer/branches/rel_1_6_0/tools/daily-scripts/update_indexes_for_ampersand_equivalency.sql 2010-04-13 16:03:01 UTC (rev 866)
@@ -0,0 +1,16 @@
+-- Cheap way of making titles and the like that contain "&"
+-- return results for well-meaning queries that use "and"
+BEGIN;
+UPDATE metabib.author_field_entry
+ SET value = value || ' and'
+ WHERE value LIKE '%&%' AND value NOT LIKE '% and %';
+UPDATE metabib.keyword_field_entry
+ SET value = value || ' and'
+ WHERE value LIKE '%&%' AND value NOT LIKE '% and %';
+UPDATE metabib.subject_field_entry
+ SET value = value || ' and'
+ WHERE value LIKE '%&%' AND value NOT LIKE '% and %';
+UPDATE metabib.title_field_entry
+ SET value = value || ' and'
+ WHERE value LIKE '%&%' AND value NOT LIKE '% and %';
+COMMIT;
More information about the open-ils-commits
mailing list