From 12fabb40831c843d5a7deeb2b56218014c0369a7 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 8 Jan 2024 14:40:38 +0000 Subject: [PATCH] Bug 35724: Database changes Sponsored-by: Waikato Institute of Technology, New Zealand Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- ...d_upload_port_and_download_port_columns.pl | 30 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 32 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_35724-add_upload_port_and_download_port_columns.pl diff --git a/installer/data/mysql/atomicupdate/bug_35724-add_upload_port_and_download_port_columns.pl b/installer/data/mysql/atomicupdate/bug_35724-add_upload_port_and_download_port_columns.pl new file mode 100755 index 0000000000..ac2855bdc3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35724-add_upload_port_and_download_port_columns.pl @@ -0,0 +1,30 @@ +use Modern::Perl; + +return { + bug_number => "35724", + description => "Add new fields to EDI accounts for librarians to configure non-standard EDI SFTP port numbers", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( !column_exists( 'vendor_edi_accounts', 'upload_port' ) ) { + $dbh->do( + q{ + ALTER TABLE vendor_edi_accounts ADD COLUMN `upload_port` varchar(40) DEFAULT '22' AFTER `password` + } + ); + + say $out "Added column 'vendor_edi_accounts.upload_port'"; + } + + if ( !column_exists( 'vendor_edi_accounts', 'download_port' ) ) { + $dbh->do( + q{ + ALTER TABLE vendor_edi_accounts ADD COLUMN `download_port` varchar(40) DEFAULT '22' AFTER `password` + } + ); + + say $out "Added column 'vendor_edi_accounts.download_port'"; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e463e8d2f4..1c60918606 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -6444,6 +6444,8 @@ CREATE TABLE `vendor_edi_accounts` ( `host` varchar(40) DEFAULT NULL, `username` varchar(40) DEFAULT NULL, `password` mediumtext DEFAULT NULL, + `upload_port` varchar(40) DEFAULT NULL, + `download_port` varchar(40) DEFAULT NULL, `last_activity` date DEFAULT NULL, `vendor_id` int(11) DEFAULT NULL, `download_directory` mediumtext DEFAULT NULL, -- 2.39.5