From 9865d34e69a93ec9d16a9eac684ba19ca83dcf64 Mon Sep 17 00:00:00 2001 From: Brendan Gallagher Date: Fri, 29 Jan 2016 17:49:33 +0000 Subject: [PATCH] DBRev for Bug 14893 - Separate temporary storage per instance in Upload.pm Signed-off-by: Brendan Gallagher --- Koha.pm | 2 +- installer/data/mysql/updatedatabase.pl | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Koha.pm b/Koha.pm index 87fd962837..a71409da31 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 = "3.23.00.016"; +$VERSION = "3.23.00.017"; sub version { return $VERSION; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e8f2f9efdc..99046acf8d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -43,6 +43,9 @@ use Koha::DateUtils; use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); +use File::Path qw[remove_tree]; # perl core module +use File::Spec; + # FIXME - The user might be installing a new database, so can't rely # on /etc/koha.conf anyway. @@ -11694,6 +11697,22 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.23.00.017"; +if ( CheckVersion($DBversion) ) { + +$dbh->do(q{ + DELETE FROM uploaded_files + WHERE COALESCE(permanent,0)=0 AND dir='koha_upload' +}); + +my $tmp= File::Spec->tmpdir.'/koha_upload'; +remove_tree( $tmp ) if -d $tmp; + + print "Upgrade to $DBversion done (Bug 14893 - Separate temporary storage per instance in Upload.pm)\n"; + SetVersion($DBversion); + +} + # 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.2