Koha/installer/data/mysql
Nick Clemens 7bb31cffae Bug 24379: Make login_attempts not nullable
While the column defaults to 0 in Koha::Object->store we set to NULL if NULLABLE

When trying to reset a patrons password we check that the account is not administratively locked:
login_attempts != -1

This query does not return rows where login_attempts IS NULL. It will return accounts where login_attempts = 0

Let's default to 0 like we intend

To test:
1 - Create a new patron
2 - Note their login_attempts is NULL
    SELECT login_attempts FROM borrowers ORDER BY borrowernumber DESC LIMIT 1
3 - Enable  OpacResetPassword
4 - Attempt to reset password before logging in, you cannot
5 - Apply patch, updatedatabase, restart_all, update schema
6 - Create another patron
7 - Their login attempts should be 0
8 - Attempt to reset password, it works!

Bug 24379: Fix the test

First we create a patron using TestBuilder to get a hashref of valid
info. Then we delete it and create a new patron using Koha::Patron->new
Once stored, we should call discard_changes to make the calculated
values available in the currenct object.

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)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-07-20 12:49:19 +02:00
..
atomicupdate Bug 24379: Make login_attempts not nullable 2020-07-20 12:49:19 +02:00
de-DE Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
en Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
fr-CA Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
fr-FR Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
it-IT Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
mandatory Bug 17355: DB changes - set is_system for categories 2020-05-04 07:57:21 +01:00
nb-NO Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
pl-PL Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
ru-RU Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
uk-UA Bug 23787: (follow-up) Format due date as due date 2020-05-12 10:58:06 +01:00
account_credit_types.sql Bug 24081: Add credit_types, offset_types and permissions 2020-03-04 14:46:13 +00:00
account_debit_types.sql Bug 25010: Fix typo 'rewewal' in debit types 2020-04-03 14:26:35 +01:00
account_offset_types.sql Bug 24081: (QA follow-up) Fix small typo 2020-03-04 14:46:25 +00:00
audio_alerts.sql Bug 11431: (QA followup) Make audio alerts sql top level 2015-11-04 12:33:53 -03:00
backfill_statistics.pl Bug 13795: Remove occurences of unused columns in code 2019-04-18 10:05:51 +00:00
fix_unclosed_nonaccruing_fines_bug17135.pl Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
kohastructure.sql Bug 24379: Make login_attempts not nullable 2020-07-20 12:49:19 +02:00
labels_upgrade.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
patroncards_upgrade.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
sysprefs.sql Bug 25232: Add ability to skip trapping items with a given notforloan value 2020-06-25 10:50:02 +02:00
update22to30.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
updatedatabase.pl Bug 24379: Make login_attempts not nullable 2020-07-20 12:49:19 +02:00
userflags.sql Bug 4461: Adding user flags for managing OPAC problem reports 2020-04-06 11:18:13 +01:00
userpermissions.sql Bug 17268: Add macros table and permissions 2020-05-04 08:25:07 +01:00