From c0830466c120ba9e0551cc40995b94e3c16ac7a1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 6 Nov 2020 12:03:17 +0000 Subject: [PATCH] Bug 24412: DBRev 20.06.00.061 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- ...ug_24412_Attach_waiting_reserve_to_desk.perl | 17 ----------------- installer/data/mysql/updatedatabase.pl | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_24412_Attach_waiting_reserve_to_desk.perl diff --git a/Koha.pm b/Koha.pm index f70e9612d5..cdb9feaab1 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 = "20.06.00.060"; +$VERSION = "20.06.00.061"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_24412_Attach_waiting_reserve_to_desk.perl b/installer/data/mysql/atomicupdate/bug_24412_Attach_waiting_reserve_to_desk.perl deleted file mode 100644 index 011b734d6a..0000000000 --- a/installer/data/mysql/atomicupdate/bug_24412_Attach_waiting_reserve_to_desk.perl +++ /dev/null @@ -1,17 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - if ( !column_exists( 'reserves', 'desk_id' ) ) { - $dbh->do(q{ - ALTER TABLE reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode, - ADD KEY desk_id (`desk_id`), - ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE SET NULL ON UPDATE CASCADE ; - }); - $dbh->do(q{ - ALTER TABLE old_reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode, - ADD KEY `old_desk_id` (`desk_id`); - }); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 24412 - Attach waiting reserve to desk)\n"; - } -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bb5c9a8849..76489d19b8 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -23235,6 +23235,23 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 25334, "Add generic 'phone' message transport type"); } +$DBversion = '20.06.00.061'; +if( CheckVersion( $DBversion ) ) { + if ( !column_exists( 'reserves', 'desk_id' ) ) { + $dbh->do(q{ + ALTER TABLE reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode, + ADD KEY desk_id (`desk_id`), + ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE SET NULL ON UPDATE CASCADE ; + }); + $dbh->do(q{ + ALTER TABLE old_reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode, + ADD KEY `old_desk_id` (`desk_id`); + }); + } + + NewVersion( $DBversion, 24412, "Attach waiting reserve to desk" ); +} + # 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