Bugzilla – Attachment 157309 Details for
Bug 26170
Add protected status for patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26170: Database update
Bug-26170-Database-update.patch (text/plain), 3.10 KB, created by
Emily-Rose Francoeur
on 2023-10-18 12:44:17 UTC
(
hide
)
Description:
Bug 26170: Database update
Filename:
MIME Type:
Creator:
Emily-Rose Francoeur
Created:
2023-10-18 12:44:17 UTC
Size:
3.10 KB
patch
obsolete
>From 432b83e24633764f1c2b449e78c43f2dc73ee6b5 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Thu, 15 Jun 2023 12:13:45 +0000 >Subject: [PATCH] Bug 26170: Database update > >--- > .../bug26170-protected-patrons.pl | 26 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 ++ > 2 files changed, 28 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug26170-protected-patrons.pl > >diff --git a/installer/data/mysql/atomicupdate/bug26170-protected-patrons.pl b/installer/data/mysql/atomicupdate/bug26170-protected-patrons.pl >new file mode 100644 >index 0000000000..5d804f85fc >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug26170-protected-patrons.pl >@@ -0,0 +1,26 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "26170", >+ description => "Create system patrons that cannot be (easily) deleted via the web UI", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ if( !column_exists( 'borrowers', 'protected' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE borrowers ADD COLUMN protected tinyint(1) NOT NULL DEFAULT 0 >+ COMMENT 'boolean flag to mark selected patrons as protected from deletion' >+ AFTER `primary_contact_method`; >+ }); >+ } >+ say $out "Added column borrowers.protected"; >+ if( !column_exists( 'deletedborrowers', 'protected' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE deletedborrowers ADD COLUMN protected tinyint(1) NOT NULL DEFAULT 0 >+ COMMENT 'boolean flag to mark selected patrons as protected from deletion' >+ AFTER `primary_contact_method`; >+ }); >+ } >+ say $out "Added column deletedborrowers.protected"; >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 822b222cfc..b07c55f1e2 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1542,6 +1542,7 @@ CREATE TABLE `borrowers` ( > `anonymized` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'flag for data anonymization', > `autorenew_checkouts` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'flag for allowing auto-renewal', > `primary_contact_method` varchar(45) DEFAULT NULL COMMENT 'useful for reporting purposes', >+ `protected` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'boolean flag to mark selected patrons as protected from deletion', > PRIMARY KEY (`borrowernumber`), > UNIQUE KEY `cardnumber` (`cardnumber`), > UNIQUE KEY `userid` (`userid`), >@@ -2669,6 +2670,7 @@ CREATE TABLE `deletedborrowers` ( > `anonymized` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'flag for data anonymization', > `autorenew_checkouts` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'flag for allowing auto-renewal', > `primary_contact_method` varchar(45) DEFAULT NULL COMMENT 'useful for reporting purposes', >+ `protected` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'boolean flag to mark selected patrons as protected from deletion', > KEY `borrowernumber` (`borrowernumber`), > KEY `cardnumber` (`cardnumber`), > KEY `sms_provider_id` (`sms_provider_id`) >-- >2.34.1
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 26170
:
154602
|
154603
|
154604
|
157247
|
157248
|
157249
|
157250
|
157309
|
157310
|
157311
|
157391
|
157392
|
157393
|
157395
|
157396
|
157397
|
157426
|
157427
|
157428
|
157629
|
157630
|
157631