Bug 17663 - DBRev 16.06.00.048
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 21 Nov 2016 16:34:46 +0000 (16:34 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 21 Nov 2016 16:34:46 +0000 (16:34 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha.pm
installer/data/mysql/atomicupdate/bug17663.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 086e707..1b1ee9f 100644 (file)
--- a/Koha.pm
+++ b/Koha.pm
@@ -29,7 +29,7 @@ use vars qw{ $VERSION };
 # - #4 : the developer version. The 4th number is the database subversion.
 #        used by developers when the database changes. updatedatabase take care of the changes itself
 #        and is automatically called by Auth.pm when needed.
-$VERSION = "16.06.00.047";
+$VERSION = "16.06.00.048";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug17663.perl b/installer/data/mysql/atomicupdate/bug17663.perl
deleted file mode 100644 (file)
index 128a501..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    $dbh->do(q|
-INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
-    (13, 'upload_general_files', 'Upload any file'),
-    (13, 'upload_manage', 'Manage uploaded files');
-    |);
-
-# Update user_permissions for current users (check count in uploaded_files)
-# Note 9 == edit_catalogue and 13 == tools
-# We do not insert if someone is superlibrarian, does not have edit_catalogue,
-# or already has all tools
-    $dbh->do(q|
-INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
-    SELECT borrowernumber, 13, 'upload_general_files'
-    FROM borrowers bo
-    WHERE flags<>1 AND flags & POW(2,13) = 0 AND
-        ( flags & POW(2,9) > 0 OR (
-            SELECT COUNT(*) FROM user_permissions
-            WHERE borrowernumber=bo.borrowernumber AND module_bit=9 ) > 0 )
-        AND ( SELECT COUNT(*) FROM uploaded_files ) > 0;
-    |);
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 17663 - Forgotten userpermissions)\n";
-}
index f1989df..93855c5 100755 (executable)
@@ -13619,6 +13619,33 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = '16.06.00.048';
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do(q|
+        INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
+        (13, 'upload_general_files', 'Upload any file'),
+        (13, 'upload_manage', 'Manage uploaded files');
+    |);
+
+    # Update user_permissions for current users (check count in uploaded_files)
+    # Note 9 == edit_catalogue and 13 == tools
+    # We do not insert if someone is superlibrarian, does not have edit_catalogue,
+    # or already has all tools
+    $dbh->do(q|
+        INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
+        SELECT borrowernumber, 13, 'upload_general_files'
+        FROM borrowers bo
+        WHERE flags<>1 AND flags & POW(2,13) = 0 AND
+            ( flags & POW(2,9) > 0 OR (
+                SELECT COUNT(*) FROM user_permissions
+                WHERE borrowernumber=bo.borrowernumber AND module_bit=9 ) > 0 )
+            AND ( SELECT COUNT(*) FROM uploaded_files ) > 0;
+    |);
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 17663 - Forgotten userpermissions)\n";
+}
+
 # DEVELOPER PROCESS, search for anything to execute in the db_update directory
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.