@@ -, +, @@ --- 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 --- a/installer/data/mysql/atomicupdate/bug_23816.perl +++ a/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"); +} --- a/installer/data/mysql/kohastructure.sql +++ a/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; --