From 23517a7e989f1df8c4fb517ce34584067acb5ee6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 26 Jan 2026 16:10:45 +0000 Subject: [PATCH] Bug 41182: Database changes --- .../definitions/erm_usage_data_provider.yaml | 5 +++++ .../data/mysql/atomicupdate/bug_41182.pl | 22 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 3 files changed, 28 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_41182.pl diff --git a/api/v1/swagger/definitions/erm_usage_data_provider.yaml b/api/v1/swagger/definitions/erm_usage_data_provider.yaml index ed6bdfe5700..7774ec08cf0 100644 --- a/api/v1/swagger/definitions/erm_usage_data_provider.yaml +++ b/api/v1/swagger/definitions/erm_usage_data_provider.yaml @@ -68,6 +68,11 @@ properties: type: - string - "null" + dateformat: + description: date format of the harvester + type: + - string + - "null" report_types: description: report types of the harvester type: diff --git a/installer/data/mysql/atomicupdate/bug_41182.pl b/installer/data/mysql/atomicupdate/bug_41182.pl new file mode 100755 index 00000000000..cdaee46cda3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_41182.pl @@ -0,0 +1,22 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "41182", + description => "Add dateformat to ERM data providers", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + unless ( column_exists( 'erm_usage_data_providers', 'dateformat' ) ) { + $dbh->do( + q{ + ALTER TABLE erm_usage_data_providers + ADD COLUMN `dateformat` int(2) COLLATE utf8mb4_unicode_ci DEFAULT 7 COMMENT 'dateformat' AFTER `requestor_email` + } + ); + say $out "Added column 'erm_usage_data_providers.dateformat'"; + + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 733015e6e22..593aebb0a65 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3275,6 +3275,7 @@ CREATE TABLE `erm_usage_data_providers` ( `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', + `dateformat` int(2) DEFAULT 7 COMMENT 'dateformat', `report_types` varchar(255) DEFAULT NULL COMMENT 'report types provided by the harvester', `service_platform` varchar(80) DEFAULT NULL COMMENT 'platform if provider requires it', PRIMARY KEY (`erm_usage_data_provider_id`) -- 2.39.5