From f17897fb105fccb7edbf60b24c7d6e5362351cb2 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 10 Jun 2016 17:15:21 +0000 Subject: [PATCH] Bug 10459 - DBRev 16.06.00.002 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- .../Bug10459_AddTimestampToBorrowers.sql | 8 ----- installer/data/mysql/updatedatabase.pl | 32 +++++++++++++++---- 3 files changed, 27 insertions(+), 15 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/Bug10459_AddTimestampToBorrowers.sql diff --git a/Koha.pm b/Koha.pm index 39d25235e2..52b62d7eaa 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.06.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 e78fff388a..eb9d1f7174 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12604,17 +12604,37 @@ if ( CheckVersion($DBversion) ) { $DBversion = "16.06.00.000"; if ( CheckVersion($DBversion) ) { - print "Upgrade to $DBversion done (Koha 16.06 - starting a new dev line at KohaCon16 in Thessaloniki, Greece! Koha is great!)\n"; - SetVersion($DBversion); + print "Upgrade to $DBversion done (Koha 16.06 - starting a new dev line at KohaCon16 in Thessaloniki, Greece! Koha is great!)\n"; + SetVersion($DBversion); } $DBversion = "16.06.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.06.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