From e20fa471bb37783307d4cb656699cd67dcdfe09e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 3 Jun 2020 12:15:28 +0000 Subject: [PATCH] Bug 24379: Don't drop default of 0 for login attempts When moving the column we drop the default, this means that DBs upgraded form earlier versions get the wrong values set To test: 1 - Checkout 16.11.x 2 - Reset all 3 - Checkout master 4 - updatedatabase 5 - SHOW CREATE TABLE borrowers; 6 - Note the column login_attempts defaults to NULL 7 - Apply patch(es) 8 - Repeat 9 - Now it defaults ot 0 (and has NOT NULL if applied all) --- installer/data/mysql/updatedatabase.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b53146f873..f43ce6a71a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14666,10 +14666,10 @@ if( CheckVersion( $DBversion ) ) { $DBversion = '17.06.00.009'; if( CheckVersion( $DBversion ) ) { $dbh->do(q{ - ALTER TABLE borrowers MODIFY COLUMN login_attempts int(4) AFTER lang; + ALTER TABLE borrowers MODIFY COLUMN login_attempts int(4) DEFAULT 0 AFTER lang; }); $dbh->do(q{ - ALTER TABLE deletedborrowers MODIFY COLUMN login_attempts int(4) AFTER lang; + ALTER TABLE deletedborrowers MODIFY COLUMN login_attempts int(4) DEFAULT 0 AFTER lang; }); SetVersion( $DBversion ); -- 2.11.0