LP#1910891: stamp DB update
authorGalen Charlton <gmc@equinoxOLI.org>
Tue, 13 Jul 2021 14:28:12 +0000 (10:28 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 13 Jul 2021 14:28:12 +0000 (10:28 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1269.data.new_booking_perms_in_map.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.new_booking_perms_in_map.sql [deleted file]

index 0e6a6f0..7cfdd3d 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 ('1268', :eg_version); -- berick/mmorgan/gmcharlt
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1269', :eg_version); -- sandbergja/tmcanna/gmcharlt
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1269.data.new_booking_perms_in_map.sql b/Open-ILS/src/sql/Pg/upgrade/1269.data.new_booking_perms_in_map.sql
new file mode 100644 (file)
index 0000000..506689e
--- /dev/null
@@ -0,0 +1,29 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1269', :eg_version);
+
+WITH perms_to_add AS
+    (SELECT id FROM
+    permission.perm_list
+    WHERE code IN ('VIEW_BOOKING_RESERVATION', 'VIEW_BOOKING_RESERVATION_ATTR_MAP'))
+
+INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
+    SELECT grp, perms_to_add.id as perm, depth, grantable
+        FROM perms_to_add,
+        permission.grp_perm_map
+        
+        --- Don't add the permissions if they have already been assigned
+        WHERE grp NOT IN
+            (SELECT DISTINCT grp FROM permission.grp_perm_map
+            INNER JOIN perms_to_add ON perm=perms_to_add.id)
+            
+        --- Anybody who can view resources should also see reservations
+        --- at the same level
+        AND perm = (
+            SELECT id
+                FROM permission.perm_list
+                WHERE code = 'VIEW_BOOKING_RESOURCE'
+        );
+
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.new_booking_perms_in_map.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.new_booking_perms_in_map.sql
deleted file mode 100644 (file)
index 56db2ee..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-BEGIN;
-
---- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-WITH perms_to_add AS
-    (SELECT id FROM
-    permission.perm_list
-    WHERE code IN ('VIEW_BOOKING_RESERVATION', 'VIEW_BOOKING_RESERVATION_ATTR_MAP'))
-
-INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
-    SELECT grp, perms_to_add.id as perm, depth, grantable
-        FROM perms_to_add,
-        permission.grp_perm_map
-        
-        --- Don't add the permissions if they have already been assigned
-        WHERE grp NOT IN
-            (SELECT DISTINCT grp FROM permission.grp_perm_map
-            INNER JOIN perms_to_add ON perm=perms_to_add.id)
-            
-        --- Anybody who can view resources should also see reservations
-        --- at the same level
-        AND perm = (
-            SELECT id
-                FROM permission.perm_list
-                WHERE code = 'VIEW_BOOKING_RESOURCE'
-        );
-
-
-COMMIT;