From abda64356eda02cedd6afd1b4f71bfe2bb2b541f Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 7 Jun 2021 16:39:34 -0400 Subject: [PATCH] LP#1931167: Missing YAOUS for DYM The baseline schema did not get updated to include the opac.did_you_mean.max_suggestions YAOUS, so fresh, rather than upgraded, Evergreen installs will be missing it. This commit adds it to the baseline and provides an upgrade script to give the setting to impacted instances. Signed-off-by: Mike Rylander --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 14 ++++++++++++++ .../src/sql/Pg/upgrade/XXXX.data.DYM_max_suggestions.sql | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.DYM_max_suggestions.sql 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 678ed4122d..1f3ef2e18a 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -21567,6 +21567,20 @@ INSERT INTO config.internal_flag (name, value, enabled) VALUES ('symspell.max_ed INSERT into config.org_unit_setting_type ( name, grp, label, description, datatype ) VALUES +( 'opac.did_you_mean.max_suggestions', 'opac', + oils_i18n_gettext( + 'opac.did_you_mean.max_suggestions', + 'Maximum number of spelling suggestions that may be offered', + 'coust', 'label'), + oils_i18n_gettext( + 'opac.did_you_mean.max_suggestions', + 'If set to -1, provide "best" suggestion if mispelled; if set higher than 0, the maximum suggestions that can be provided; if set to 0, disable suggestions.', + 'coust', 'description'), + 'integer' ); + +INSERT into config.org_unit_setting_type +( name, grp, label, description, datatype ) +VALUES ( 'opac.did_you_mean.low_result_threshold', 'opac', oils_i18n_gettext( 'opac.did_you_mean.low_result_threshold', diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.DYM_max_suggestions.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.DYM_max_suggestions.sql new file mode 100644 index 0000000000..021daf249f --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.DYM_max_suggestions.sql @@ -0,0 +1,15 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT into config.org_unit_setting_type +( name, grp, label, description, datatype ) +SELECT 'opac.did_you_mean.max_suggestions', + 'opac', + 'Maximum number of spelling suggestions that may be offered', + 'If set to -1, provide "best" suggestion if mispelled; if set higher than 0, the maximum suggestions that can be provided; if set to 0, disable suggestions.', + 'integer' + WHERE NOT EXISTS (SELECT 1 FROM config.org_unit_setting_type WHERE name = 'opac.did_you_mean.max_suggestions'); + +COMMIT; + -- 2.11.0