From 09f1806987fc4fef5f4601b042f59986fb66d8de Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 21 Aug 2018 11:25:53 +0000 Subject: [PATCH] Bug 20773: DBRev 18.05.02.003 Signed-off-by: Nick Clemens (cherry picked from commit 7dab4cd903f9623fb52592e65d57c93b6156d2aa) Signed-off-by: Martin Renvoize (cherry picked from commit 31bf49b849a949c9f809d2ca2eaa1cecafb55036) Signed-off-by: Fridolin Somers (cherry picked from commit a27a32cab66a0c6a529d0f7918256d5615737dea) Signed-off-by: Fridolin Somers --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_20773.perl | 11 ----------- installer/data/mysql/updatedatabase.pl | 11 +++++++++++ 3 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_20773.perl diff --git a/Koha.pm b/Koha.pm index fa8b488fbc..9fdee7fb71 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 = "17.05.13.000"; +$VERSION = "17.05.13.001"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_20773.perl b/installer/data/mysql/atomicupdate/bug_20773.perl deleted file mode 100644 index d93d30433f..0000000000 --- a/installer/data/mysql/atomicupdate/bug_20773.perl +++ /dev/null @@ -1,11 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - my $dtf = Koha::Database->new->schema->storage->datetime_parser; - my $days = C4::Context->preference('MaxPickupDelay') || 7; - my $date = DateTime->now()->add( days => $days ); - my $sql = q|UPDATE reserves SET expirationdate = ? WHERE expirationdate IS NULL AND waitingdate IS NOT NULL|; - $dbh->do( $sql, undef, $dtf->format_datetime($date) ); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 20724 - expirationdate filled for waiting holds)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4a91e9a41a..d7e904c5fa 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14695,6 +14695,17 @@ if ( CheckVersion($DBversion) ) { print "Upgrade to $DBversion done (Koha 17.05.13)\n"; } +$DBversion = '17.05.13.001'; +if( CheckVersion( $DBversion ) ) { + my $dtf = Koha::Database->new->schema->storage->datetime_parser; + my $days = C4::Context->preference('MaxPickupDelay') || 7; + my $date = DateTime->now()->add( days => $days ); + my $sql = q|UPDATE reserves SET expirationdate = ? WHERE expirationdate IS NULL AND waitingdate IS NOT NULL|; + $dbh->do( $sql, undef, $dtf->format_datetime($date) ); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20773 - expirationdate filled for waiting holds)\n"; +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5