From 3cb8446d760dd67c9f834eb911b6982e9b9a11ef Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 21 Jun 2021 11:56:17 +0000 Subject: [PATCH] Bug 15788: DBRev 21.06.00.004 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_15788.perl | 18 ------------------ installer/data/mysql/updatedatabase.pl | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_15788.perl diff --git a/Koha.pm b/Koha.pm index f981253cb1..8d6d2a92a0 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 = "21.06.00.003"; +$VERSION = "21.06.00.004"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_15788.perl b/installer/data/mysql/atomicupdate/bug_15788.perl deleted file mode 100644 index 44e67c5b6e..0000000000 --- a/installer/data/mysql/atomicupdate/bug_15788.perl +++ /dev/null @@ -1,18 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if ( CheckVersion($DBversion) ) { - - $dbh->do( - qq{ - INSERT IGNORE permissions (module_bit, code, description) - VALUES - (4, 'delete_borrowers', 'Delete borrowers') - } - ); - - $dbh->do(q{ - INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code) - SELECT borrowernumber, 4, 'delete_borrowers' FROM user_permissions WHERE code = 'edit_borrowers' - }); - - NewVersion( $DBversion, 15788, "Split edit_borrowers permission" ); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a17b45bbfc..5a604db32e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -24348,6 +24348,23 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 24434, "Add 'WrongTransfer' to branchtransfers.cancellation_reason enum"); } +$DBversion = '21.06.00.004'; +if ( CheckVersion($DBversion) ) { + + $dbh->do(q{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (4, 'delete_borrowers', 'Delete borrowers') + }); + + $dbh->do(q{ + INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code) + SELECT borrowernumber, 4, 'delete_borrowers' FROM user_permissions WHERE code = 'edit_borrowers' + }); + + NewVersion( $DBversion, 15788, "Split edit_borrowers permission" ); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5