| 
      
            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 | 
                                `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(`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 | 
                  },  | 
            
            
              | 26 | 
              }  |