Bug 31020: Fix PassItemMarcToXSLT in system preferences description
[koha.git] / installer / data / mysql / db_revs / 220600011.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "30275",
5     description => "Add a checkout_renewals table",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh, $out) = @$args{qw(dbh out)};
9         unless ( TableExists('checkout_renewals') ) {
10             $dbh->do(q{
11                 CREATE TABLE `checkout_renewals` (
12                   `renewal_id` int(11) NOT NULL auto_increment,
13                   `checkout_id` int(11) DEFAULT NULL COMMENT 'the id of the checkout this renewal pertains to',
14                   `renewer_id` int(11) DEFAULT NULL COMMENT 'the id of the user who processed the renewal',
15                   `seen` tinyint(1) DEFAULT 0 COMMENT 'boolean denoting whether the item was present or not',
16                   `interface` varchar(16) NOT NULL COMMENT 'the interface this renewal took place on',
17                   `timestamp` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'the date and time the renewal took place',
18                   PRIMARY KEY(`renewal_id`),
19                   KEY `renewer_id` (`renewer_id`),
20                   CONSTRAINT `renewals_renewer_id` FOREIGN KEY (`renewer_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
21                 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
22             });
23             say $out "Added new table 'checkout_renewals'";
24
25             $dbh->do(q{ ALTER TABLE `issues` CHANGE `renewals` `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed' });
26             say $out "Renamed `issues.renewals` to `issues.renewals_count`";
27
28             $dbh->do(q{ ALTER TABLE `old_issues` CHANGE `renewals` `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed' });
29             say $out "Renamed `old_issues.renewals` to `old_issues.renewals_count`";
30         }
31     },
32 }