@@ -, +, @@ --- .../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 --- a/installer/data/mysql/atomicupdate/bug_22456.pl +++ a/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; + }); + } + }, +}; --- a/installer/data/mysql/kohastructure.sql +++ a/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` -- --