From ac5fbb0f510b277a3554c7140dd4ecf7ca1815bd Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 24 Jul 2020 21:55:44 +0000 Subject: [PATCH] Bug 24379: DBRev 20.05.02.001 Signed-off-by: Lucas Gass --- Koha.pm | 2 +- .../atomicupdate/make_login_attempts_not_nullable.perl | 8 -------- installer/data/mysql/updatedatabase.pl | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/make_login_attempts_not_nullable.perl diff --git a/Koha.pm b/Koha.pm index 63ff01b36d..d35ecd49fe 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 = "20.05.02.000"; +$VERSION = "20.05.02.001"; 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 4fd6b399f2..0000000000 --- a/installer/data/mysql/atomicupdate/make_login_attempts_not_nullable.perl +++ /dev/null @@ -1,8 +0,0 @@ -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" ); - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug XXXXX - Set login_attempts NOT NULL)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 86653ebdad..793f3da67d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -22225,6 +22225,15 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, undef, '20.05.02 release' ); } +$DBversion = '20.05.02.001'; +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" ); + NewVersion( $DBversion, 24379, "Set login_attempts NOT NULL" ); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5