From c004a9128a8ee60292dc7d62d6020e21589ae8fd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 3 Mar 2021 13:44:52 +0000 Subject: [PATCH] Bug 26057: DBRev 20.12.00.019 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_26057.perl | 13 ------------ installer/data/mysql/updatedatabase.pl | 20 +++++++++++++++++++ 3 files changed, 21 insertions(+), 14 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_26057.perl diff --git a/Koha.pm b/Koha.pm index 91acdd7b0f..faf03df754 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.12.00.018"; +$VERSION = "20.12.00.019"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_26057.perl b/installer/data/mysql/atomicupdate/bug_26057.perl deleted file mode 100644 index efcfa797ab..0000000000 --- a/installer/data/mysql/atomicupdate/bug_26057.perl +++ /dev/null @@ -1,13 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - if( !column_exists( 'branchtransfers', 'datecancelled' ) ) { - $dbh->do( "ALTER TABLE `branchtransfers` ADD COLUMN `datecancelled` datetime default NULL AFTER `datearrived`" ); - } - - if( !column_exists( 'branchtransfers', 'cancellation_reason' ) ) { - $dbh->do( "ALTER TABLE `branchtransfers` ADD COLUMN `cancellation_reason` ENUM('Manual', 'StockrotationAdvance', 'StockrotationRepatriation', 'ReturnToHome', 'ReturnToHolding', 'RotatingCollection', 'Reserve', 'LostReserve', 'CancelReserve') DEFAULT NULL AFTER `reason`" ); - } - - NewVersion( $DBversion, 26057, "Add datecancelled field to branchtransfers"); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a5fa10a4a4..5cf9c9b7c3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -23581,6 +23581,26 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 27808, "Adjust items.onloan if needed" ); } +$DBversion = '20.12.00.019'; +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'branchtransfers', 'datecancelled' ) ) { + $dbh->do(q| + ALTER TABLE `branchtransfers` + ADD COLUMN `datecancelled` datetime default NULL AFTER `datearrived` + |); + } + + if( !column_exists( 'branchtransfers', 'cancellation_reason' ) ) { + $dbh->do(q| + ALTER TABLE `branchtransfers` + ADD COLUMN `cancellation_reason` ENUM('Manual', 'StockrotationAdvance', 'StockrotationRepatriation', 'ReturnToHome', 'ReturnToHolding', 'RotatingCollection', 'Reserve', 'LostReserve', 'CancelReserve') DEFAULT NULL AFTER `reason` + |); + } + + NewVersion( $DBversion, 26057, "Add datecancelled field to branchtransfers"); +} + # 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