From db891d33f0bbe75748fd725036066f45c2e762fe Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 7 Sep 2015 11:12:49 -0300 Subject: [PATCH] Bug 14717: DBRev 3.21.00.023 Signed-off-by: Tomas Cohen Arazi --- Koha.pm | 2 +- ...7_get_rid_of_0000-00-00_borrowers_table.sql | 4 ---- installer/data/mysql/updatedatabase.pl | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_14717_get_rid_of_0000-00-00_borrowers_table.sql diff --git a/Koha.pm b/Koha.pm index ee96adf9b6..60991e5789 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.21.00.022"; +$VERSION = "3.21.00.023"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_14717_get_rid_of_0000-00-00_borrowers_table.sql b/installer/data/mysql/atomicupdate/bug_14717_get_rid_of_0000-00-00_borrowers_table.sql deleted file mode 100644 index 8b73b30da5..0000000000 --- a/installer/data/mysql/atomicupdate/bug_14717_get_rid_of_0000-00-00_borrowers_table.sql +++ /dev/null @@ -1,4 +0,0 @@ -update borrowers set debarred = NULL where debarred = '0000-00-00'; -update borrowers set dateexpiry = NULL where dateexpiry = '0000-00-00'; -update borrowers set dateofbirth = NULL where dateofbirth = '0000-00-00'; -update borrowers set dateenrolled = NULL where dateenrolled = '0000-00-00'; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7f340a6a17..9729e33e0c 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -10814,6 +10814,24 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.21.00.023"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + UPDATE borrowers SET debarred=NULL WHERE debarred='0000-00-00' + }); + $dbh->do(q{ + UPDATE borrowers SET dateexpiry=NULL where dateexpiry='0000-00-00' + }); + $dbh->do(q{ + UPDATE borrowers SET dateofbirth=NULL where dateofbirth='0000-00-00' + }); + $dbh->do(q{ + UPDATE borrowers SET dateenrolled=NULL where dateenrolled='0000-00-00' + }); + print "Upgrade to $DBversion done (Bug 14717: Prevent 0000-00-00 dates in patron data)\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.5