From 0a5d2d5844dab4636d35d86c2883476fa39ef9b8 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Wed, 15 Apr 2020 16:12:16 -0300 Subject: [PATCH] Bug 23816: Update kohastructure and atomic update Sponsored-by: Northeast Kansas Library - NEKLS Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Katrin Fischer --- installer/data/mysql/atomicupdate/bug_23816.perl | 14 ++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_23816.perl diff --git a/installer/data/mysql/atomicupdate/bug_23816.perl b/installer/data/mysql/atomicupdate/bug_23816.perl new file mode 100644 index 0000000000..6266f46bf1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23816.perl @@ -0,0 +1,14 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); + if( !column_exists( 'categories', 'min_password_length' ) ) { + $dbh->do("ALTER TABLE categories ADD COLUMN `min_password_length` smallint(6) NULL DEFAULT NULL AFTER `change_password` -- set minimum password length for patrons in this category"); + } + if( !column_exists( 'categories', 'require_strong_password' ) ) { + $dbh->do("ALTER TABLE categories ADD COLUMN `require_strong_password` TINYINT(1) NULL DEFAULT NULL AFTER `min_password_length` -- set required password strength for patrons in this category"); + } + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 23816, "Add min_password_length and require_strong_password columns in categories table"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0316e4be19..3a5b63efee 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -328,6 +328,8 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow, `change_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can change their passwords in the OAPC `exclude_from_local_holds_priority` tinyint(1) default NULL, -- Exclude patrons of this category from local holds priority + `min_password_length` smallint(6) NULL DEFAULT NULL, -- set minimum password length for patrons in this category + `require_strong_password` TINYINT(1) NULL DEFAULT NULL, -- set required password strength for patrons in this category PRIMARY KEY (`categorycode`), UNIQUE KEY `categorycode` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.28.0