5 description => "Allow cancelling waiting holds",
8 my ($dbh, $out) = @$args{qw(dbh out)};
10 unless ( TableExists( 'hold_cancellation_requests' ) ) {
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 `creation_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'Time and date the cancellation request was created',
16 PRIMARY KEY (`hold_cancellation_request_id`)
17 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
21 my ($count) = $dbh->selectrow_array(q{
23 FROM circulation_rules
24 WHERE rule_name = 'waiting_hold_cancellation'
29 INSERT INTO circulation_rules (rule_name, rule_value)
30 VALUES ('waiting_hold_cancellation', 0)
34 say $out "Found already existing 'waiting_hold_cancellation' circulation rules on the DB. Please review.";