Bug 24379: DBRev 20.06.00.005
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 20 Jul 2020 10:53:43 +0000 (12:53 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 20 Jul 2020 12:05:21 +0000 (14:05 +0200)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Koha.pm
installer/data/mysql/atomicupdate/make_login_attempts_not_nullable.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index b4d9bd2..afeffa8 100644 (file)
--- 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.06.00.004";
+$VERSION = "20.06.00.005";
 
 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 (file)
index 4fd6b39..0000000
+++ /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";
-}
index eb3ce36..0ede609 100755 (executable)
@@ -22235,6 +22235,15 @@ if( CheckVersion( $DBversion ) ) {
     NewVersion( $DBversion, 25851, "Remove holdallowed rule if value is an empty string");
 }
 
+$DBversion = '20.06.00.005';
+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/';