Bug 31017: DB Updates

Signed-off-by: KIT Library Germany <michaela.sieber@kit.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-06-23 10:57:31 +00:00 committed by Tomas Cohen Arazi
parent 7b645b0208
commit f0010cb39d
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,20 @@
use Modern::Perl;
return {
bug_number => "31017",
description => "Add type option to vendors",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
unless( column_exists('aqbooksellers','vendor_type') ){
$dbh->do(q{
ALTER TABLE aqbooksellers ADD COLUMN vendor_type varchar(255) DEFAULT NULL AFTER accountnumber
});
say $out "Added vendor_type column";
}
$dbh->do(q{
INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) VALUES ('VENDOR_TYPE', 1);
});
say $out "Added VENDOR_TYPE authorised value category";
},
};

View file

@ -404,6 +404,7 @@ CREATE TABLE `aqbooksellers` (
`address4` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'fourth line of vendor physical address',
`phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'vendor phone number',
`accountnumber` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'vendor account number',
`vendor_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`notes` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'order notes',
`postal` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'vendor postal address (all lines)',
`url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'vendor web address',