Bug 7651: DBRev 18.06.00.007
authorNick Clemens <nick@bywatersolutions.com>
Wed, 18 Jul 2018 18:07:00 +0000 (18:07 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 18 Jul 2018 19:11:27 +0000 (19:11 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha.pm
installer/data/mysql/atomicupdate/bug763_currencies_manage_permission.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 2d7b9cf..307fc20 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 = "18.06.00.006";
+$VERSION = "18.06.00.007";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug763_currencies_manage_permission.sql b/installer/data/mysql/atomicupdate/bug763_currencies_manage_permission.sql
deleted file mode 100644 (file)
index a8a74ee..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-INSERT INTO permissions (module_bit, code, description) VALUES (11, 'currencies_manage', 'Manage currencies and exchange rates');
-
-INSERT INTO user_permissions (borrowernumber, module_bit, code)
-  SELECT borrowernumber, 11, 'currencies_manage' FROM borrowers WHERE flags & (1 << 3) OR borrowernumber IN
-  (SELECT borrowernumber FROM user_permissions WHERE code = 'parameters_remaining_permissions');
-
--- Bug 7651: Add new permission currencies_manage and update staff users
index 1167c84..23fc71b 100755 (executable)
@@ -16143,6 +16143,18 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 19524 - Share patron lists between staff)\n";
 }
 
+$DBversion = '18.06.00.007';
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do( "INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (11, 'currencies_manage', 'Manage currencies and exchange rates');" );
+    $dbh->do(q{
+        INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
+            SELECT borrowernumber, 11, 'currencies_manage' FROM borrowers WHERE flags & (1 << 3) OR borrowernumber IN
+            (SELECT borrowernumber FROM user_permissions WHERE code = 'parameters_remaining_permissions');
+    });
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 7651 - Add separate permission for managing currencies and exchange rates)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.