Bugzilla – Attachment 130116 Details for
Bug 29924
Introduce password expiration to patron categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29924: Database updates
Bug-29924-Database-updates.patch (text/plain), 4.90 KB, created by
Nick Clemens
on 2022-02-02 15:07:10 UTC
(
hide
)
Description:
Bug 29924: Database updates
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2022-02-02 15:07:10 UTC
Size:
4.90 KB
patch
obsolete
>From 48f8c9b30a2624aeb41af41060b9683551cefee9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 21 Jan 2022 16:59:41 +0000 >Subject: [PATCH] Bug 29924: Database updates > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../mysql/atomicupdate/password_expire.pl | 30 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 3 ++ > 2 files changed, 33 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/password_expire.pl > >diff --git a/installer/data/mysql/atomicupdate/password_expire.pl b/installer/data/mysql/atomicupdate/password_expire.pl >new file mode 100755 >index 0000000000..2982685b45 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/password_expire.pl >@@ -0,0 +1,30 @@ >+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"; >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 4411ae7604..3d96ca55ca 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1413,6 +1413,7 @@ CREATE TABLE `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', >@@ -1638,6 +1639,7 @@ CREATE TABLE `categories` ( > `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', >@@ -2421,6 +2423,7 @@ CREATE TABLE `deletedborrowers` ( > `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', >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29924
:
129705
|
129706
|
129707
|
129708
|
129762
|
129763
|
129764
|
129765
|
129766
|
129823
|
129953
|
129954
|
129955
|
129956
|
129957
|
130116
|
130117
|
130118
|
130119
|
130120
|
130495
|
130500
|
130501
|
130502
|
130503
|
130504
|
130505
|
130557
|
130558
|
130559
|
130560
|
130561
|
130562
|
130563
|
130677
|
130678
|
130679
|
130680
|
130681
|
130682
|
130683
|
131128
|
132059
|
132060
|
132061
|
132062
|
132063
|
132064
|
132065
|
132066
|
132084
|
132085
|
132086
|
132087
|
132088
|
132089
|
132090
|
132091
|
132092
|
133741
|
133742
|
133743
|
133744
|
133745
|
133746
|
133747
|
133748
|
133801
|
133802
|
133803
|
133804
|
133805
|
133806
|
133807
|
133808
|
133809
|
133810
|
133989
|
134758