Stamping upgrade script
authorMike Rylander <mrylander@gmail.com>
Thu, 24 Mar 2022 18:34:57 +0000 (14:34 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 24 Mar 2022 18:36:51 +0000 (14:36 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1319.data.angular-copy-templates.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-copy-templates.sql [deleted file]

index 7f52d01..ac7bdc6 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 ('1313', :eg_version); -- alynn26/berick
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1319', :eg_version); -- berick/miker
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1319.data.angular-copy-templates.sql b/Open-ILS/src/sql/Pg/upgrade/1319.data.angular-copy-templates.sql
new file mode 100644 (file)
index 0000000..8fe7d45
--- /dev/null
@@ -0,0 +1,33 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1319', :eg_version);
+
+DO $SQL$
+BEGIN
+    
+    PERFORM TRUE FROM config.usr_setting_type WHERE name = 'cat.copy.templates';
+
+    IF NOT FOUND THEN -- no matching user setting
+
+        PERFORM TRUE FROM config.workstation_setting_type WHERE name = 'cat.copy.templates';
+
+        IF NOT FOUND THEN
+            -- no matching workstation setting
+            -- Migrate the existing user setting and its data to the new name.
+
+            UPDATE config.usr_setting_type 
+            SET name = 'cat.copy.templates' 
+            WHERE name = 'webstaff.cat.copy.templates';
+
+            UPDATE actor.usr_setting
+            SET name = 'cat.copy.templates' 
+            WHERE name = 'webstaff.cat.copy.templates';
+
+        END IF;
+    END IF;
+
+END; 
+$SQL$;
+
+COMMIT;
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-copy-templates.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-copy-templates.sql
deleted file mode 100644 (file)
index 9de4034..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-BEGIN;
-
--- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
-
-DO $SQL$
-BEGIN
-    
-    PERFORM TRUE FROM config.usr_setting_type WHERE name = 'cat.copy.templates';
-
-    IF NOT FOUND THEN -- no matching user setting
-
-        PERFORM TRUE FROM config.workstation_setting_type WHERE name = 'cat.copy.templates';
-
-        IF NOT FOUND THEN
-            -- no matching workstation setting
-            -- Migrate the existing user setting and its data to the new name.
-
-            UPDATE config.usr_setting_type 
-            SET name = 'cat.copy.templates' 
-            WHERE name = 'webstaff.cat.copy.templates';
-
-            UPDATE actor.usr_setting
-            SET name = 'cat.copy.templates' 
-            WHERE name = 'webstaff.cat.copy.templates';
-
-        END IF;
-    END IF;
-
-END; 
-$SQL$;
-
-COMMIT;
-