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 ('0661', :eg_version); -- berick/dbs
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0662', :eg_version); -- berick/miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
--- /dev/null
+-- Evergreen DB patch 0662.schema.coded-value-map-index-normalizer.sql
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0662', :eg_version);
+
+-- create the normalizer
+CREATE OR REPLACE FUNCTION evergreen.coded_value_map_normalizer( input TEXT, ctype TEXT )
+ RETURNS TEXT AS $F$
+ SELECT COALESCE(value,$1)
+ FROM config.coded_value_map
+ WHERE ctype = $2 AND code = $1;
+$F$ LANGUAGE SQL;
+
+-- register the normalizer
+INSERT INTO config.index_normalizer (name, description, func, param_count) VALUES (
+ 'Coded Value Map Normalizer',
+ 'Applies coded_value_map mapping of values',
+ 'coded_value_map_normalizer',
+ 1
+);
+
+COMMIT;
+++ /dev/null
--- Evergreen DB patch XXXX.schema.coded-value-map-index-normalizer.sql
---
-BEGIN;
-
--- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
--- create the normalizer
-CREATE OR REPLACE FUNCTION evergreen.coded_value_map_normalizer( input TEXT, ctype TEXT )
- RETURNS TEXT AS $F$
- SELECT COALESCE(value,$1)
- FROM config.coded_value_map
- WHERE ctype = $2 AND code = $1;
-$F$ LANGUAGE SQL;
-
--- register the normalizer
-INSERT INTO config.index_normalizer (name, description, func, param_count) VALUES (
- 'Coded Value Map Normalizer',
- 'Applies coded_value_map mapping of values',
- 'coded_value_map_normalizer',
- 1
-);
-
-COMMIT;