From ac71c2e7da2777e3bb1cb4c457412dc7b0e94776 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Fri, 10 Jun 2016 17:15:21 +0000 Subject: [PATCH] Bug 10459 - DBRev 16.05.00.002 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Frédéric Demians --- Koha.pm | 2 +- .../Bug10459_AddTimestampToBorrowers.sql | 8 ------ installer/data/mysql/updatedatabase.pl | 28 ++++++++++++++++--- 3 files changed, 25 insertions(+), 13 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/Bug10459_AddTimestampToBorrowers.sql diff --git a/Koha.pm b/Koha.pm index 39d25235e2..23f1ae8b50 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.001"; +$VERSION = "16.05.00.002"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/Bug10459_AddTimestampToBorrowers.sql b/installer/data/mysql/atomicupdate/Bug10459_AddTimestampToBorrowers.sql deleted file mode 100644 index 6f428c3ae2..0000000000 --- a/installer/data/mysql/atomicupdate/Bug10459_AddTimestampToBorrowers.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE borrowers - ADD COLUMN updated_on timestamp NULL DEFAULT CURRENT_TIMESTAMP - ON UPDATE CURRENT_TIMESTAMP - AFTER privacy_guarantor_checkouts; -ALTER TABLE deletedborrowers - ADD COLUMN updated_on timestamp NULL DEFAULT CURRENT_TIMESTAMP - ON UPDATE CURRENT_TIMESTAMP - AFTER privacy_guarantor_checkouts; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 3c3f2eda99..7da6aa2b38 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12604,11 +12604,31 @@ if ( CheckVersion($DBversion) ) { $DBversion = "16.05.00.001"; if ( CheckVersion($DBversion) ) { - $dbh->do(q{ - UPDATE accountlines SET accounttype='HE', description=itemnumber WHERE (description REGEXP '^Hold waiting too long [0-9]+') AND accounttype='F'; + $dbh->do(q{ + UPDATE accountlines SET accounttype='HE', description=itemnumber WHERE (description REGEXP '^Hold waiting too long [0-9]+') AND accounttype='F'; }); - print "Upgrade to $DBversion done (Bug 16200 - 'Hold waiting too long' fee has a translation problem)\n"; - SetVersion($DBversion); + + print "Upgrade to $DBversion done (Bug 16200 - 'Hold waiting too long' fee has a translation problem)\n"; + SetVersion($DBversion); +} + +$DBversion = "16.05.00.002"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + ALTER TABLE borrowers + ADD COLUMN updated_on timestamp NULL DEFAULT CURRENT_TIMESTAMP + ON UPDATE CURRENT_TIMESTAMP + AFTER privacy_guarantor_checkouts; + }); + $dbh->do(q{ + ALTER TABLE deletedborrowers + ADD COLUMN updated_on timestamp NULL DEFAULT CURRENT_TIMESTAMP + ON UPDATE CURRENT_TIMESTAMP + AFTER privacy_guarantor_checkouts; + }); + + print "Upgrade to $DBversion done (Bug 10459 - borrowers should have a timestamp)\n"; + SetVersion($DBversion); } -- 2.39.5