From b28deaa933036c7840b0e4fef065b21c5a2fd7b6 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 --- .../data/mysql/atomicupdate/bug_37934.pl | 26 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 8 +++--- 2 files changed, 30 insertions(+), 4 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 9b7dc7fc6e..93ad196454 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3261,9 +3261,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', @@ -6796,4 +6796,4 @@ CREATE TABLE `zebraqueue` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-11-25 12:13:27 \ No newline at end of file +-- Dump completed on 2024-11-25 12:13:27 -- 2.39.5