From 90977aef1e097da42695bc6944834a81496f0dbb Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 18 Jul 2018 18:07:00 +0000 Subject: [PATCH] Bug 7651: DBRev 18.06.00.007 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- .../bug763_currencies_manage_permission.sql | 7 ------- installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ 3 files changed, 13 insertions(+), 8 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug763_currencies_manage_permission.sql diff --git a/Koha.pm b/Koha.pm index 2d7b9cf387..307fc20a24 100644 --- 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 index a8a74ee202..0000000000 --- a/installer/data/mysql/atomicupdate/bug763_currencies_manage_permission.sql +++ /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 diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 1167c8408c..23fc71b5bf 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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.