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

(-)a/installer/data/mysql/atomicupdate/bug_30275.pl (-1 / +26 lines)
Line 0 Link Here
0
- 
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
                  `id` int(11) NOT NULL auto_increment,
13
                  `issue_id` int(11) DEFAULT NULL COMMENT 'the id of the issue this renewal pertains to',
14
                  `renewed_by` 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(`id`),
19
                  KEY `renewed_by` (`renewed_by`),
20
                  CONSTRAINT `renewals_renewed_by` FOREIGN KEY (`renewed_by`) 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
    },
26
}

Return to bug 30275