LP#1813191: stamp DB update
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 12 Aug 2021 20:05:56 +0000 (16:05 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 12 Aug 2021 20:05:56 +0000 (16:05 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1278.schema.dewey_ranges.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.dewey_ranges.sql [deleted file]

index 9cd0618..2b96988 100644 (file)
@@ -92,7 +92,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 ('1277', :eg_version); -- gmcharlt/rfrasur/berick
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1278', :eg_version); -- JBoyer/terranm/gmcharlt
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1278.schema.dewey_ranges.sql b/Open-ILS/src/sql/Pg/upgrade/1278.schema.dewey_ranges.sql
new file mode 100644 (file)
index 0000000..7016261
--- /dev/null
@@ -0,0 +1,30 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1278', :eg_version);
+
+CREATE OR REPLACE VIEW reporter.asset_call_number_dewey AS
+  SELECT id AS call_number,
+    call_number_dewey(label) AS dewey,
+    CASE WHEN call_number_dewey(label) ~ '^[0-9]+\.?[0-9]*$'::text
+      THEN btrim(to_char(10::double precision * floor(call_number_dewey(label)::double precision / 10::double precision), '000'::text))
+      ELSE NULL::text
+    END AS dewey_block_tens,
+    CASE WHEN call_number_dewey(label) ~ '^[0-9]+\.?[0-9]*$'::text
+      THEN btrim(to_char(100::double precision * floor(call_number_dewey(label)::double precision / 100::double precision), '000'::text))
+      ELSE NULL::text
+    END AS dewey_block_hundreds,
+    CASE WHEN call_number_dewey(label) ~ '^[0-9]+\.?[0-9]*$'::text
+      THEN (btrim(to_char(10::double precision * floor(call_number_dewey(label)::double precision / 10::double precision), '000'::text)) || '-'::text)
+      || btrim(to_char(10::double precision * floor(call_number_dewey(label)::double precision / 10::double precision) + 9::double precision, '000'::text))
+      ELSE NULL::text
+    END AS dewey_range_tens,
+    CASE WHEN call_number_dewey(label) ~ '^[0-9]+\.?[0-9]*$'::text
+      THEN (btrim(to_char(100::double precision * floor(call_number_dewey(label)::double precision / 100::double precision), '000'::text)) || '-'::text)
+      || btrim(to_char(100::double precision * floor(call_number_dewey(label)::double precision / 100::double precision) + 99::double precision, '000'::text))
+      ELSE NULL::text
+    END AS dewey_range_hundreds
+  FROM asset.call_number
+  WHERE call_number_dewey(label) ~ '^[0-9]'::text;
+
+COMMIT;
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.dewey_ranges.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.dewey_ranges.sql
deleted file mode 100644 (file)
index a2a6a8c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-CREATE OR REPLACE VIEW reporter.asset_call_number_dewey AS
-  SELECT id AS call_number,
-    call_number_dewey(label) AS dewey,
-    CASE WHEN call_number_dewey(label) ~ '^[0-9]+\.?[0-9]*$'::text
-      THEN btrim(to_char(10::double precision * floor(call_number_dewey(label)::double precision / 10::double precision), '000'::text))
-      ELSE NULL::text
-    END AS dewey_block_tens,
-    CASE WHEN call_number_dewey(label) ~ '^[0-9]+\.?[0-9]*$'::text
-      THEN btrim(to_char(100::double precision * floor(call_number_dewey(label)::double precision / 100::double precision), '000'::text))
-      ELSE NULL::text
-    END AS dewey_block_hundreds,
-    CASE WHEN call_number_dewey(label) ~ '^[0-9]+\.?[0-9]*$'::text
-      THEN (btrim(to_char(10::double precision * floor(call_number_dewey(label)::double precision / 10::double precision), '000'::text)) || '-'::text)
-      || btrim(to_char(10::double precision * floor(call_number_dewey(label)::double precision / 10::double precision) + 9::double precision, '000'::text))
-      ELSE NULL::text
-    END AS dewey_range_tens,
-    CASE WHEN call_number_dewey(label) ~ '^[0-9]+\.?[0-9]*$'::text
-      THEN (btrim(to_char(100::double precision * floor(call_number_dewey(label)::double precision / 100::double precision), '000'::text)) || '-'::text)
-      || btrim(to_char(100::double precision * floor(call_number_dewey(label)::double precision / 100::double precision) + 99::double precision, '000'::text))
-      ELSE NULL::text
-    END AS dewey_range_hundreds
-  FROM asset.call_number
-  WHERE call_number_dewey(label) ~ '^[0-9]'::text;
-
-COMMIT;
-