From ba8155f7d011a3829d2d736d79c9036362191bd5 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 23 Jul 2018 14:58:05 +0000 Subject: [PATCH] Bug 11911: DBRev 18.06.00.012 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- .../atomicupdate/bug11911_suggestions_permission.sql | 6 ------ installer/data/mysql/updatedatabase.pl | 8 ++++++++ 3 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug11911_suggestions_permission.sql diff --git a/Koha.pm b/Koha.pm index cb89396e2c..ba450bc416 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.011"; +$VERSION = "18.06.00.012"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug11911_suggestions_permission.sql b/installer/data/mysql/atomicupdate/bug11911_suggestions_permission.sql deleted file mode 100644 index 9ce0fbccfc..0000000000 --- a/installer/data/mysql/atomicupdate/bug11911_suggestions_permission.sql +++ /dev/null @@ -1,6 +0,0 @@ -INSERT INTO permissions (module_bit, code, description) VALUES (11, 'suggestions_manage', 'Manage purchase suggestions'); - -INSERT INTO user_permissions (borrowernumber, module_bit, code) - SELECT borrowernumber, 11, 'suggestions_manage' FROM borrowers WHERE flags & (1 << 2); - --- Bug 19911: Add new permission suggestions_manage and update staff users diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 41a58a376b..6e967b89bb 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -16214,6 +16214,14 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 17698: Add column issues.noteseen and old_issues.noteseen)\n"; } +$DBversion = '18.06.00.012'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q|INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (11, 'suggestions_manage', 'Manage purchase suggestions');|); + $dbh->do(q|INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code) SELECT borrowernumber, 11, 'suggestions_manage' FROM borrowers WHERE flags & (1 << 2);|); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 11911 - Add separate permission for managing suggestions)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.20.1