Bug 23816: DBRev 20.06.00.037

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2020-09-09 13:13:45 +00:00
parent 1a1402d066
commit f3c199ac14
4 changed files with 14 additions and 16 deletions

View file

@ -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.036";
$VERSION = "20.06.00.037";
sub version {
return $VERSION;

View file

@ -1,14 +0,0 @@
$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");
}

View file

@ -327,9 +327,9 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr
`checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'.
`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
`exclude_from_local_holds_priority` tinyint(1) default NULL, -- Exclude patrons of this category from local holds priority
PRIMARY KEY (`categorycode`),
UNIQUE KEY `categorycode` (`categorycode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View file

@ -22777,6 +22777,18 @@ if( CheckVersion( $DBversion ) ) {
NewVersion( $DBversion, 20168, "Update OPACSearchForTitleIn to work with Bootstrap 4");
}
$DBversion = '20.06.00.037';
if( CheckVersion( $DBversion ) ) {
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");
}
NewVersion( $DBversion, 23816, "Add min_password_length and require_strong_password columns in categories table");
}
# 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/';