From cc1c82edb6f1e7d93412ede157303e65d342e859 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 9 Sep 2016 14:06:17 +0000 Subject: [PATCH] Bug 17187 - DBRev 16.06.00.023 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- .../mysql/atomicupdate/Bug_17187_dbrev.perl | 30 ------------------- installer/data/mysql/updatedatabase.pl | 21 +++++++++++++ 3 files changed, 22 insertions(+), 31 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/Bug_17187_dbrev.perl diff --git a/Koha.pm b/Koha.pm index d77d4edb0a..1f5e7a9f7c 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 = "16.06.00.022"; +$VERSION = "16.06.00.023"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/Bug_17187_dbrev.perl b/installer/data/mysql/atomicupdate/Bug_17187_dbrev.perl deleted file mode 100644 index 0edffcfef9..0000000000 --- a/installer/data/mysql/atomicupdate/Bug_17187_dbrev.perl +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/perl - -use Modern::Perl; -use C4::Context; - -my $dbh = C4::Context->dbh; -my $DBversion = 'XXX'; - -# @RM: Copy from here - -#if ( CheckVersion($DBversion) ) { -if ( 1 ) { #FIXME - my $pref = C4::Context->preference('timeout'); - if( !$pref || $pref eq '12000000' ) { - # update if pref is null or equals old default value - $dbh->do(q| -UPDATE systempreferences SET value = '1d', type = 'Free' -WHERE variable = 'timeout' - |); - print "Upgrade to $DBversion done (Bug 17187)\nNote: Pref value for timeout has been adjusted.\n"; - } else { - # only update pref type - $dbh->do(q| -UPDATE systempreferences SET type = 'Free' -WHERE variable = 'timeout' - |); - print "Upgrade to $DBversion done (Bug 17187)\nNote: Pref value for timeout has not been adjusted.\n"; - } - #SetVersion($DBversion); #FIXME -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 54a29a14b1..deab87a390 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12926,6 +12926,27 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "16.06.00.023"; +if ( CheckVersion($DBversion) ) { + my $pref = C4::Context->preference('timeout'); + if( !$pref || $pref eq '12000000' ) { + # update if pref is null or equals old default value + $dbh->do(q| + UPDATE systempreferences SET value = '1d', type = 'Free' + WHERE variable = 'timeout' + |); + print "Upgrade to $DBversion done (Bug 17187)\nNote: Pref value for timeout has been adjusted.\n"; + } else { + # only update pref type + $dbh->do(q| + UPDATE systempreferences SET type = 'Free' + WHERE variable = 'timeout' + |); + print "Upgrade to $DBversion done (Bug 17187)\nNote: Pref value for timeout has not been adjusted.\n"; + } + SetVersion($DBversion); #FIXME +} + # 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