View | Details | Raw Unified | Return to bug 22456
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_22456.pl (+29 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "22456",
5
    description => "Allow cancelling waiting holds",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        unless ( TableExists( 'hold_cancellation_requests' ) ) {
11
            $dbh->do(q{
12
                CREATE TABLE `hold_cancellation_requests` (
13
                `hold_cancellation_request_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the cancellation request',
14
                `hold_id` int(11) NOT null COMMENT 'ID of the hold',
15
                `requester_id` int(11) NULL DEFAULT NULL COMMENT 'ID of the user that made the cancellation request',
16
                `creation_date` timestamp NULL DEFAULT NULL COMMENT 'Time and date the cancellation request was created',
17
                `source` ENUM('owner') NOT NULL DEFAULT 'owner' COMMENT 'The source for the cancellation request',
18
                `status` ENUM('requested','accepted','rejected') DEFAULT 'requested' COMMENT 'request status',
19
                `resolution_date` timestamp NULL DEFAULT NULL COMMENT 'Time and date cancellation request was resolved',
20
                `resolver_id` int(11) NULL DEFAULT NULL COMMENT 'ID of the staff member that resolved the request',
21
                PRIMARY KEY (`hold_cancellation_request_id`),
22
                UNIQUE KEY `hold_requester_uniq` (`hold_id`, `requester_id`),
23
                CONSTRAINT `hc_requester_ibfk` FOREIGN KEY (`requester_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
24
                CONSTRAINT `hc_resolver_ibfk` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
25
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
26
            });
27
        }
28
    },
29
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +23 lines)
Lines 4415-4420 CREATE TABLE `reserves` ( Link Here
4415
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4415
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4416
/*!40101 SET character_set_client = @saved_cs_client */;
4416
/*!40101 SET character_set_client = @saved_cs_client */;
4417
4417
4418
--
4419
-- Table structure for table `hold_cancellation_requests`
4420
--
4421
4422
DROP TABLE IF EXISTS `hold_cancellation_requests`;
4423
/*!40101 SET @saved_cs_client     = @@character_set_client */;
4424
/*!40101 SET character_set_client = utf8 */;
4425
CREATE TABLE `hold_cancellation_requests` (
4426
  `hold_cancellation_request_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the cancellation request',
4427
  `hold_id` int(11) NOT null COMMENT 'ID of the hold',
4428
  `requester_id` int(11) NULL DEFAULT NULL COMMENT 'ID of the user that made the cancellation request',
4429
  `creation_date` timestamp NULL DEFAULT NULL COMMENT 'Time and date the cancellation request was created',
4430
  `source` ENUM('owner') NOT NULL DEFAULT 'owner' COMMENT 'The source for the cancellation request',
4431
  `status` ENUM('requested','accepted','rejected') DEFAULT 'requested' COMMENT 'request status',
4432
  `resolution_date` timestamp NULL DEFAULT NULL COMMENT 'Time and date cancellation request was resolved',
4433
  `resolver_id` int(11) NULL DEFAULT NULL COMMENT 'ID of the staff member that resolved the request',
4434
  PRIMARY KEY (`hold_cancellation_request_id`),
4435
  UNIQUE KEY `hold_requester_uniq` (`hold_id`, `requester_id`),
4436
  CONSTRAINT `hc_requester_ibfk` FOREIGN KEY (`requester_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4437
  CONSTRAINT `hc_resolver_ibfk` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
4438
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4439
/*!40101 SET character_set_client = @saved_cs_client */;
4440
4418
--
4441
--
4419
-- Table structure for table `return_claims`
4442
-- Table structure for table `return_claims`
4420
--
4443
--
4421
- 

Return to bug 22456