| 
      
            Line 0
          
      
      
        Link Here
      
     | 
  
            
               | 
               | 
              1 | 
              use Modern::Perl;  | 
            
            
              | 2 | 
               | 
            
            
              | 3 | 
              return { | 
            
            
              | 4 | 
                  bug_number => "33105",  | 
            
            
              | 5 | 
                  description => "A vendor issues",  | 
            
            
              | 6 | 
                  up => sub { | 
            
            
              | 7 | 
                      my ($args) = @_;  | 
            
            
              | 8 | 
                      my ($dbh, $out) = @$args{qw(dbh out)}; | 
            
            
              | 9 | 
                      # Do you stuffs here  | 
            
            
              | 10 | 
                      unless (TableExists('aqbookseller_issues')) { | 
            
            
              | 11 | 
                          $dbh->do(q{ | 
            
            
              | 12 | 
                              CREATE TABLE `aqbookseller_issues` (  | 
            
            
              | 13 | 
                                `issue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha',  | 
            
            
              | 14 | 
                                `vendor_id` int(11) NOT NULL COMMENT 'link to the vendor',  | 
            
            
              | 15 | 
                                `type` varchar(80) DEFAULT NULL COMMENT "type of the issue, authorised value VENDOR_ISSUE_TYPE",  | 
            
            
              | 16 | 
                                `started_on` date DEFAULT NULL COMMENT 'start of the issue',  | 
            
            
              | 17 | 
                                `ended_on` date DEFAULT NULL COMMENT 'end of the issue',  | 
            
            
              | 18 | 
                                `notes` longtext DEFAULT NULL COMMENT 'notes',  | 
            
            
              | 19 | 
                                PRIMARY KEY (`issue_id`),  | 
            
            
              | 20 | 
                                CONSTRAINT `aqbookseller_issues_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE  | 
            
            
              | 21 | 
                              ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;  | 
            
            
              | 22 | 
                          });  | 
            
            
              | 23 | 
                          say $out "Added new table 'aqbookseller_issues'";  | 
            
            
              | 24 | 
                      }  | 
            
            
              | 25 | 
               | 
            
            
              | 26 | 
                      $dbh->do(q{ | 
            
            
              | 27 | 
                          INSERT IGNORE INTO permissions (module_bit, code, description) VALUES  | 
            
            
              | 28 | 
                          (11, 'issue_manage', 'Manage issues');  | 
            
            
              | 29 | 
                      });  | 
            
            
              | 30 | 
                      say $out "Added new permission 'acquisition.issue_manage'";  | 
            
            
              | 31 | 
               | 
            
            
              | 32 | 
                      $dbh->do(q{ | 
            
            
              | 33 | 
                          INSERT IGNORE INTO authorised_value_categories (category_name, is_system)  | 
            
            
              | 34 | 
                          VALUES  | 
            
            
              | 35 | 
                              ('VENDOR_ISSUE_TYPE', 1) | 
            
            
              | 36 | 
                      });  | 
            
            
              | 37 | 
                      $dbh->do(q{ | 
            
            
              | 38 | 
                          INSERT IGNORE INTO authorised_values (category, authorised_value, lib)  | 
            
            
              | 39 | 
                          VALUES  | 
            
            
              | 40 | 
                              ('VENDOR_ISSUE_TYPE', 'MAINTENANCE', 'Maintenance'), | 
            
            
              | 41 | 
                              ('VENDOR_ISSUE_TYPE', 'OUTAGE', 'Outage') | 
            
            
              | 42 | 
                      });  | 
            
            
              | 43 | 
                      say $out "Added new authorised value category 'VENDOR_ISSUE_TYPE'";  | 
            
            
              | 44 | 
                  },  | 
            
            
              | 45 | 
              };  |