Bugzilla – Attachment 97831 Details for
Bug 24476
Allow patrons to opt-out of auto-renewal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24476: Database updates
Bug-24476-Database-updates.patch (text/plain), 2.86 KB, created by
Nick Clemens (kidclamp)
on 2020-01-23 17:52:24 UTC
(
hide
)
Description:
Bug 24476: Database updates
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-01-23 17:52:24 UTC
Size:
2.86 KB
patch
obsolete
>From a63aec651e9e1e9ca9c550229e1acfea4224dd4c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 23 Jan 2020 02:35:38 +0000 >Subject: [PATCH] Bug 24476: Database updates > >--- > .../bug_24476_opt_out_of_auto_renewal.perl | 18 ++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 ++ > 2 files changed, 20 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl b/installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl >new file mode 100644 >index 0000000000..c06a2a876f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl >@@ -0,0 +1,18 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ unless( column_exists('borrowers','autorenewal') ){ >+ $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenewal TINYINT(1) NOT NULL DEFAULT 1" ); >+ } >+ unless( column_exists('deletedborrowers','autorenewal') ){ >+ $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenewal TINYINT(1) NOT NULL DEFAULT 1" ); >+ } >+ $dbh->do(q{ >+ UPDATE systempreferences >+ SET value = CONCAT(value,'|autorenewal') >+ WHERE variable IN >+ ('PatronSelfModificationBorrowerUnwantedField','PatronSelfRegistrationBorrowerUnwantedField') >+ AND value NOT LIKE '%autorenewal%' >+ }); >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 24476 - Allow patrons to opt-out of autorenewal)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 3f28188c02..7a29b9bfa8 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -590,6 +590,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower > `login_attempts` int(4) default 0, -- number of failed login attemps > `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token > `anonymized` TINYINT(1) NOT NULL DEFAULT 0, -- flag for data anonymization >+ `autorenewal` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal > KEY borrowernumber (borrowernumber), > KEY `cardnumber` (`cardnumber`), > KEY `sms_provider_id` (`sms_provider_id`) >@@ -1585,6 +1586,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons > `login_attempts` int(4) default 0, -- number of failed login attemps > `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token > `anonymized` TINYINT(1) NOT NULL DEFAULT 0, -- flag for data anonymization >+ `autorenewal` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal > UNIQUE KEY `cardnumber` (`cardnumber`), > PRIMARY KEY `borrowernumber` (`borrowernumber`), > KEY `categorycode` (`categorycode`), >-- >2.11.0
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 24476
:
97766
|
97767
|
97768
|
97769
|
97770
|
97831
|
97832
|
97833
|
97834
|
97835
|
97836
|
97923
|
97924
|
97925
|
97926
|
97927
|
97928
|
97997
|
97998
|
97999
|
98000
|
98001
|
98002
|
99793
|
99794
|
99795
|
99796
|
99797
|
99798
|
99799
|
99800
|
100022
|
100023
|
100024
|
100025
|
100026
|
100027
|
100028
|
100029
|
101385
|
101419
|
101420
|
101421
|
101422
|
101423
|
101424
|
101425
|
101426
|
101427
|
101511
|
101512
|
101513
|
101514
|
101515
|
101516
|
101517
|
101518
|
101519
|
101520
|
101521
|
101542