|
Line 0
Link Here
|
|
|
1 |
use Modern::Perl; |
| 2 |
|
| 3 |
return { |
| 4 |
bug_number => "33104", |
| 5 |
description => "Add vendor interfaces", |
| 6 |
up => sub { |
| 7 |
my ($args) = @_; |
| 8 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
| 9 |
unless ( TableExists('aqbookseller_interfaces') ) { |
| 10 |
$dbh->do(q{ |
| 11 |
CREATE TABLE `aqbookseller_interfaces` ( |
| 12 |
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha', |
| 13 |
`vendor_id` int(11) NOT NULL COMMENT 'link to the vendor', |
| 14 |
`type` varchar(80) DEFAULT NULL COMMENT "type of the interface, authorised value VENDOR_INTERFACE_TYPE", |
| 15 |
`name` varchar(255) NOT NULL COMMENT 'name of the interface', |
| 16 |
`uri` mediumtext DEFAULT NULL COMMENT 'uri of the interface', |
| 17 |
`login` varchar(255) DEFAULT NULL COMMENT 'login', |
| 18 |
`password` mediumtext DEFAULT NULL COMMENT 'hashed password', |
| 19 |
`account_email` mediumtext DEFAULT NULL COMMENT 'account email', |
| 20 |
`notes` longtext DEFAULT NULL COMMENT 'notes', |
| 21 |
PRIMARY KEY (`id`), |
| 22 |
CONSTRAINT `aqbookseller_interfaces_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
| 23 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
| 24 |
}); |
| 25 |
say $out "Added new table 'aqbookseller_interfaces'"; |
| 26 |
} |
| 27 |
|
| 28 |
$dbh->do(q{ |
| 29 |
INSERT IGNORE INTO authorised_value_categories (category_name, is_system) |
| 30 |
VALUES |
| 31 |
('VENDOR_INTERFACE_TYPE', 1) |
| 32 |
}); |
| 33 |
$dbh->do(q{ |
| 34 |
INSERT IGNORE INTO authorised_values (category, authorised_value, lib) |
| 35 |
VALUES |
| 36 |
('VENDOR_INTERFACE_TYPE', 'ADMIN', 'Admin'), |
| 37 |
('VENDOR_INTERFACE_TYPE', 'ORDERS', 'Orders'), |
| 38 |
('VENDOR_INTERFACE_TYPE', 'REPORTS', 'Reports') |
| 39 |
}); |
| 40 |
say $out "Added new authorised value category 'VENDOR_INTERFACE_TYPE'"; |
| 41 |
}, |
| 42 |
}; |