--- /dev/null
+use Modern::Perl;
+
+return {
+ bug_number => "BUG_NUMBER",
+ description => "Add password expiration",
+ up => sub {
+ my ($args) = @_;
+ my ($dbh, $out) = @$args{qw(dbh out)};
+ unless( column_exists('categories', 'password_expiry_days') ){
+ $dbh->do(q{
+ ALTER TABLE categories ADD password_expiry_days SMALLINT(5) NULL DEFAULT NULL AFTER enrolmentperioddate
+ });
+ say $out "Added password_expiry_days to categories";
+ }
+ unless( column_exists('borrowers', 'password_expiration_date') ){
+ $dbh->do(q{
+ ALTER TABLE borrowers ADD password_expiration_date DATE NULL DEFAULT NULL AFTER dateexpiry
+ });
+ # Print useful stuff here
+ say $out "Added password_expiration_date field to borrowers";
+ }
+ unless( column_exists('deletedborrowers', 'password_expiration_date') ){
+ $dbh->do(q{
+ ALTER TABLE deletedborrowers ADD password_expiration_date DATE NULL DEFAULT NULL AFTER dateexpiry
+ });
+ # Print useful stuff here
+ say $out "Added password_expiration_date field to borrowers";
+ }
+ },
+};
`categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'foreign key from the categories table, includes the code of the patron category',
`dateenrolled` date DEFAULT NULL COMMENT 'date the patron was added to Koha (YYYY-MM-DD)',
`dateexpiry` date DEFAULT NULL COMMENT 'date the patron/borrower''s card is set to expire (YYYY-MM-DD)',
+ `password_expiration_date` date DEFAULT NULL COMMENT 'date the patron/borrower''s password is set to expire (YYYY-MM-DD)',
`date_renewed` date DEFAULT NULL COMMENT 'date the patron/borrower''s card was last renewed',
`gonenoaddress` tinyint(1) DEFAULT NULL COMMENT 'set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address',
`lost` tinyint(1) DEFAULT NULL COMMENT 'set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card',
`description` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'description of the patron category',
`enrolmentperiod` smallint(6) DEFAULT NULL COMMENT 'number of months the patron is enrolled for (will be NULL if enrolmentperioddate is set)',
`enrolmentperioddate` date DEFAULT NULL COMMENT 'date the patron is enrolled until (will be NULL if enrolmentperiod is set)',
+ `password_expiry_days` smallint(6) DEFAULT NULL COMMENT 'number of days after which the patron must reset their password',
`upperagelimit` smallint(6) DEFAULT NULL COMMENT 'age limit for the patron',
`dateofbirthrequired` tinyint(1) DEFAULT NULL COMMENT 'the minimum age required for the patron category',
`finetype` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'unused in Koha',
`categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'foreign key from the categories table, includes the code of the patron category',
`dateenrolled` date DEFAULT NULL COMMENT 'date the patron was added to Koha (YYYY-MM-DD)',
`dateexpiry` date DEFAULT NULL COMMENT 'date the patron/borrower''s card is set to expire (YYYY-MM-DD)',
+ `password_expiration_date` date DEFAULT NULL COMMENT 'date the patron/borrower''s password is set to expire (YYYY-MM-DD)',
`date_renewed` date DEFAULT NULL COMMENT 'date the patron/borrower''s card was last renewed',
`gonenoaddress` tinyint(1) DEFAULT NULL COMMENT 'set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address',
`lost` tinyint(1) DEFAULT NULL COMMENT 'set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card',