Stamping upgrade script for coded value map index normalizer
authorMike Rylander <mrylander@gmail.com>
Wed, 4 Jan 2012 15:36:08 +0000 (10:36 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 4 Jan 2012 15:36:08 +0000 (10:36 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0662.schema.coded-value-map-index-normalizer.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql [deleted file]

index 8eba8b3..642048f 100644 (file)
@@ -86,7 +86,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 ('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,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0662.schema.coded-value-map-index-normalizer.sql b/Open-ILS/src/sql/Pg/upgrade/0662.schema.coded-value-map-index-normalizer.sql
new file mode 100644 (file)
index 0000000..1c9694f
--- /dev/null
@@ -0,0 +1,24 @@
+-- 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;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql
deleted file mode 100644 (file)
index 2cc1c80..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
--- 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;