From cfb78f005fde4764a0d19e2ff61167a0218cc845 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 1 Apr 2025 09:26:53 +0000 Subject: [PATCH] Bug 37934: Extend data types for customer ID, requestor ID, and API key for ERM data providers This changes the datatype of customer ID, requestor ID, and API key from limited varchar to text to accustom for longer values. To test: * Apply the patch * Run updatedatabase (a sandbox will do this automatically) * Activate the ERM module in the system preferences (ERMModule) * Go to E-ressource management > Data providers > New data provider * Make sure you can enter values longer than 265 in the fields named above and that they are stored correctly. Signed-off-by: Jesse Maseto Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer (cherry picked from commit c1356f46678dd86a7d85cdadf6a7be12e93b6c80) Signed-off-by: Fridolin Somers --- .../data/mysql/atomicupdate/bug_37934.pl | 26 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 6 ++--- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_37934.pl diff --git a/installer/data/mysql/atomicupdate/bug_37934.pl b/installer/data/mysql/atomicupdate/bug_37934.pl new file mode 100755 index 0000000000..eb2b1ac523 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37934.pl @@ -0,0 +1,26 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "37934", + description => "Extend storable data for customer ID, requestor ID and API Key for ERM data providers", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ALTER TABLE erm_usage_data_providers MODIFY COLUMN customer_id text DEFAULT NULL COMMENT 'SUSHI customer ID'} + ); + say_success( $out, "Updated erm_usage_data_providers.customer_id to datatype text" ); + + $dbh->do( + q{ALTER TABLE erm_usage_data_providers MODIFY COLUMN requestor_id text DEFAULT NULL COMMENT 'SUSHI requestor ID'} + ); + say_success( $out, "Updated erm_usage_data_providers.requestor_id to datatype text" ); + + $dbh->do( + q{ALTER TABLE erm_usage_data_providers MODIFY COLUMN api_key text DEFAULT NULL COMMENT 'SUSHI API key'}); + say_success( $out, "Updated erm_usage_data_providers.api_key to datatype text" ); + + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3bf15c1007..668e53ed01 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3220,9 +3220,9 @@ CREATE TABLE `erm_usage_data_providers` ( `service_type` varchar(80) DEFAULT NULL COMMENT 'service_type of the harvester', `service_url` varchar(80) DEFAULT NULL COMMENT 'service_url of the harvester', `report_release` varchar(80) DEFAULT NULL COMMENT 'report_release of the harvester', - `customer_id` varchar(50) DEFAULT NULL COMMENT 'sushi customer id', - `requestor_id` varchar(50) DEFAULT NULL COMMENT 'sushi requestor id', - `api_key` varchar(80) DEFAULT NULL COMMENT 'sushi api key', + `customer_id` text DEFAULT NULL COMMENT 'SUSHI customer ID', + `requestor_id` text DEFAULT NULL COMMENT 'SUSHI requestor ID', + `api_key` text DEFAULT NULL COMMENT 'SUSHI API key', `requestor_name` varchar(80) DEFAULT NULL COMMENT 'requestor name', `requestor_email` varchar(80) DEFAULT NULL COMMENT 'requestor email', `report_types` varchar(255) DEFAULT NULL COMMENT 'report types provided by the harvester',