From e7e6a8bc72b4fc9783d9478aead80ac70113f007 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 23 Jun 2022 10:57:31 +0000 Subject: [PATCH] Bug 31017: DB Updates Signed-off-by: KIT Library Germany --- .../data/mysql/atomicupdate/bug_31017.pl | 20 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_31017.pl diff --git a/installer/data/mysql/atomicupdate/bug_31017.pl b/installer/data/mysql/atomicupdate/bug_31017.pl new file mode 100755 index 0000000000..bf97b870e1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_31017.pl @@ -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"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 6f43bdb954..1c42172886 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -403,6 +403,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', -- 2.30.2