From 04da28e407c2536abea8e38c274b1d97d4714330 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 5 Aug 2020 12:07:40 +1200 Subject: [PATCH] Bug 24379: DBRev 19.05.14.002 Signed-off-by: Aleisha Amohia (cherry picked from commit a2139daaa53acfa90d855a5e0df76b47fb964139) Signed-off-by: Victor Grousset/tuxayo --- Koha.pm | 2 +- .../atomicupdate/make_login_attempts_not_nullable.perl | 9 --------- installer/data/mysql/updatedatabase.pl | 10 ++++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/make_login_attempts_not_nullable.perl diff --git a/Koha.pm b/Koha.pm index cf8409cce1..f0e2f3bbff 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 = "19.05.14.001"; +$VERSION = "19.05.14.002"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/make_login_attempts_not_nullable.perl b/installer/data/mysql/atomicupdate/make_login_attempts_not_nullable.perl deleted file mode 100644 index deaf78c564..0000000000 --- a/installer/data/mysql/atomicupdate/make_login_attempts_not_nullable.perl +++ /dev/null @@ -1,9 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - $dbh->do( "UPDATE borrowers SET login_attempts=0 WHERE login_attempts IS NULL" ); - $dbh->do( "ALTER TABLE borrowers MODIFY COLUMN login_attempts int(4) NOT NULL DEFAULT 0" ); - $dbh->do( "UPDATE deletedborrowers SET login_attempts=0 WHERE login_attempts IS NULL" ); - $dbh->do( "ALTER TABLE deletedborrowers MODIFY COLUMN login_attempts int(4) NOT NULL DEFAULT 0" ); - print "Upgrade to $DBversion done (Bug 24379 - Set login_attempts NOT NULL)\n"; - SetVersion( $DBversion ); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 18d49b4712..228a8b1937 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -19143,6 +19143,16 @@ if( CheckVersion( $DBversion ) ) { SetVersion( $DBversion ); } +$DBversion = "19.05.14.002"; +if( CheckVersion( $DBversion ) ) { + $dbh->do( "UPDATE borrowers SET login_attempts=0 WHERE login_attempts IS NULL" ); + $dbh->do( "ALTER TABLE borrowers MODIFY COLUMN login_attempts int(4) NOT NULL DEFAULT 0" ); + $dbh->do( "UPDATE deletedborrowers SET login_attempts=0 WHERE login_attempts IS NULL" ); + $dbh->do( "ALTER TABLE deletedborrowers MODIFY COLUMN login_attempts int(4) NOT NULL DEFAULT 0" ); + print "Upgrade to $DBversion done (Bug 24379 - Set login_attempts NOT NULL)\n"; + SetVersion( $DBversion ); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5