Bugzilla – Attachment 135165 Details for
Bug 22456
Allow patrons to cancel their waiting holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22456: Add cancellation request table
Bug-22456-Add-cancellation-request-table.patch (text/plain), 4.75 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-05-18 20:40:15 UTC
(
hide
)
Description:
Bug 22456: Add cancellation request table
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-05-18 20:40:15 UTC
Size:
4.75 KB
patch
obsolete
>From e864fc799bdf172b2323bb22aac7815cc91fb92c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 18 Apr 2022 10:45:02 -0300 >Subject: [PATCH] Bug 22456: Add cancellation request table > >This patch adds a new table, for storing holds cancellation requests, >and managing them afterwards. > >The *hold_id* attribute is not made a FK on the reserves table because >of the old_reserves thing we still do (see bug 25260 for a discussion >about it). >--- > .../data/mysql/atomicupdate/bug_22456.pl | 29 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 23 +++++++++++++++ > 2 files changed, 52 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_22456.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_22456.pl b/installer/data/mysql/atomicupdate/bug_22456.pl >new file mode 100755 >index 0000000000..a75fd439a7 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_22456.pl >@@ -0,0 +1,29 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "22456", >+ description => "Allow cancelling waiting holds", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ unless ( TableExists( 'hold_cancellation_requests' ) ) { >+ $dbh->do(q{ >+ CREATE TABLE `hold_cancellation_requests` ( >+ `hold_cancellation_request_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the cancellation request', >+ `hold_id` int(11) NOT null COMMENT 'ID of the hold', >+ `requester_id` int(11) NULL DEFAULT NULL COMMENT 'ID of the user that made the cancellation request', >+ `creation_date` timestamp NULL DEFAULT NULL COMMENT 'Time and date the cancellation request was created', >+ `source` ENUM('owner') NOT NULL DEFAULT 'owner' COMMENT 'The source for the cancellation request', >+ `status` ENUM('requested','accepted','rejected') DEFAULT 'requested' COMMENT 'request status', >+ `resolution_date` timestamp NULL DEFAULT NULL COMMENT 'Time and date cancellation request was resolved', >+ `resolver_id` int(11) NULL DEFAULT NULL COMMENT 'ID of the staff member that resolved the request', >+ PRIMARY KEY (`hold_cancellation_request_id`), >+ UNIQUE KEY `hold_requester_uniq` (`hold_id`, `requester_id`), >+ CONSTRAINT `hc_requester_ibfk` FOREIGN KEY (`requester_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `hc_resolver_ibfk` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ }); >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 852d448804..31c6b90c87 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4415,6 +4415,29 @@ CREATE TABLE `reserves` ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >+-- >+-- Table structure for table `hold_cancellation_requests` >+-- >+ >+DROP TABLE IF EXISTS `hold_cancellation_requests`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8 */; >+CREATE TABLE `hold_cancellation_requests` ( >+ `hold_cancellation_request_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the cancellation request', >+ `hold_id` int(11) NOT null COMMENT 'ID of the hold', >+ `requester_id` int(11) NULL DEFAULT NULL COMMENT 'ID of the user that made the cancellation request', >+ `creation_date` timestamp NULL DEFAULT NULL COMMENT 'Time and date the cancellation request was created', >+ `source` ENUM('owner') NOT NULL DEFAULT 'owner' COMMENT 'The source for the cancellation request', >+ `status` ENUM('requested','accepted','rejected') DEFAULT 'requested' COMMENT 'request status', >+ `resolution_date` timestamp NULL DEFAULT NULL COMMENT 'Time and date cancellation request was resolved', >+ `resolver_id` int(11) NULL DEFAULT NULL COMMENT 'ID of the staff member that resolved the request', >+ PRIMARY KEY (`hold_cancellation_request_id`), >+ UNIQUE KEY `hold_requester_uniq` (`hold_id`, `requester_id`), >+ CONSTRAINT `hc_requester_ibfk` FOREIGN KEY (`requester_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `hc_resolver_ibfk` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+/*!40101 SET character_set_client = @saved_cs_client */; >+ > -- > -- Table structure for table `return_claims` > -- >-- >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 22456
:
135165
|
135166
|
135167
|
135168
|
135169
|
135170
|
135171
|
135319
|
135320
|
135321
|
135322
|
135323
|
135324
|
135325
|
135326
|
135349
|
135350
|
135351
|
135352
|
135396
|
135397
|
135398
|
135399
|
135400
|
135401
|
135402
|
135403
|
135404
|
135405
|
135406
|
135407
|
135408
|
135409
|
135410
|
135411
|
135430
|
135830
|
135831
|
135832
|
135838
|
135839
|
135840
|
135841
|
135842
|
135843
|
135844
|
135845
|
135846
|
137580
|
137581
|
137582
|
137583
|
137584
|
137585
|
137586
|
137587
|
137588
|
137589
|
137591
|
138209
|
138210
|
138211
|
138212
|
138213
|
138214
|
138215
|
138216
|
138217
|
138218