From 5a08ad2863f79fe2df45df79af1fc2c383b15491 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 23 Oct 2023 12:37:32 +0000 Subject: [PATCH] Bug 34587: Update database columns length Some COUNTER files have long data in these fields and were causing new database entries to fail Signed-off-by: Jessica Zairo Signed-off-by: Michaela Sieber Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/ErmUsageDatabase.pm | 8 ++-- Koha/Schema/Result/ErmUsageTitle.pm | 37 +++++++++---------- .../erm_usage_statistics_tables.pl | 18 ++++----- installer/data/mysql/kohastructure.sql | 18 ++++----- 4 files changed, 40 insertions(+), 41 deletions(-) diff --git a/Koha/Schema/Result/ErmUsageDatabase.pm b/Koha/Schema/Result/ErmUsageDatabase.pm index 02db8a0069..81bbb13cf8 100644 --- a/Koha/Schema/Result/ErmUsageDatabase.pm +++ b/Koha/Schema/Result/ErmUsageDatabase.pm @@ -59,7 +59,7 @@ Publisher for the database data_type: 'varchar' is_nullable: 1 - size: 24 + size: 255 Publisher ID for the database @@ -83,7 +83,7 @@ __PACKAGE__->add_columns( "publisher", { data_type => "varchar", is_nullable => 1, size => 255 }, "publisher_id", - { data_type => "varchar", is_nullable => 1, size => 24 }, + { data_type => "varchar", is_nullable => 1, size => 255 }, "usage_data_provider_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); @@ -148,8 +148,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-09-18 15:59:44 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aKPQT+piqnU4mqUHDXTXQw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-10-23 12:49:36 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:O8PzChQgNwsjoLfWZhPwiQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/ErmUsageTitle.pm b/Koha/Schema/Result/ErmUsageTitle.pm index 2a77a041b4..6923096aff 100644 --- a/Koha/Schema/Result/ErmUsageTitle.pm +++ b/Koha/Schema/Result/ErmUsageTitle.pm @@ -33,9 +33,8 @@ primary key =head2 title - data_type: 'varchar' + data_type: 'mediumtext' is_nullable: 1 - size: 255 item title @@ -51,7 +50,7 @@ platform the title is harvested by data_type: 'varchar' is_nullable: 1 - size: 24 + size: 255 DOI number for the title @@ -59,7 +58,7 @@ DOI number for the title data_type: 'varchar' is_nullable: 1 - size: 24 + size: 255 Print ISSN number for the title @@ -67,7 +66,7 @@ Print ISSN number for the title data_type: 'varchar' is_nullable: 1 - size: 24 + size: 255 Online ISSN number for the title @@ -75,7 +74,7 @@ Online ISSN number for the title data_type: 'varchar' is_nullable: 1 - size: 24 + size: 255 URI number for the title @@ -91,7 +90,7 @@ Publisher for the title data_type: 'varchar' is_nullable: 1 - size: 24 + size: 255 Publisher ID for the title @@ -99,7 +98,7 @@ Publisher ID for the title data_type: 'varchar' is_nullable: 1 - size: 24 + size: 255 year of publication of the title @@ -107,7 +106,7 @@ year of publication of the title data_type: 'varchar' is_nullable: 1 - size: 24 + size: 255 ISBN of the title @@ -117,25 +116,25 @@ __PACKAGE__->add_columns( "title_id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "title", - { data_type => "varchar", is_nullable => 1, size => 255 }, + { data_type => "mediumtext", is_nullable => 1 }, "usage_data_provider_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "title_doi", - { data_type => "varchar", is_nullable => 1, size => 24 }, + { data_type => "varchar", is_nullable => 1, size => 255 }, "print_issn", - { data_type => "varchar", is_nullable => 1, size => 24 }, + { data_type => "varchar", is_nullable => 1, size => 255 }, "online_issn", - { data_type => "varchar", is_nullable => 1, size => 24 }, + { data_type => "varchar", is_nullable => 1, size => 255 }, "title_uri", - { data_type => "varchar", is_nullable => 1, size => 24 }, + { data_type => "varchar", is_nullable => 1, size => 255 }, "publisher", { data_type => "varchar", is_nullable => 1, size => 255 }, "publisher_id", - { data_type => "varchar", is_nullable => 1, size => 24 }, + { data_type => "varchar", is_nullable => 1, size => 255 }, "yop", - { data_type => "varchar", is_nullable => 1, size => 24 }, + { data_type => "varchar", is_nullable => 1, size => 255 }, "isbn", - { data_type => "varchar", is_nullable => 1, size => 24 }, + { data_type => "varchar", is_nullable => 1, size => 255 }, ); =head1 PRIMARY KEY @@ -198,8 +197,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-09-18 15:59:44 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mgP48bpl+C3oD/7IHLgQTw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-10-24 09:31:02 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VfDbgXBq+c2rSXC1A6js5Q sub koha_object_class { diff --git a/installer/data/mysql/atomicupdate/erm_usage_statistics_tables.pl b/installer/data/mysql/atomicupdate/erm_usage_statistics_tables.pl index a4014b99bb..f7b22835d4 100644 --- a/installer/data/mysql/atomicupdate/erm_usage_statistics_tables.pl +++ b/installer/data/mysql/atomicupdate/erm_usage_statistics_tables.pl @@ -86,16 +86,16 @@ return { q{ CREATE TABLE `erm_usage_titles` ( `title_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', - `title` varchar(255) DEFAULT NULL COMMENT 'item title', + `title` mediumtext DEFAULT NULL COMMENT 'item title', `usage_data_provider_id` int(11) NOT NULL COMMENT 'platform the title is harvested by', - `title_doi` varchar(24) DEFAULT NULL COMMENT 'DOI number for the title', - `print_issn` varchar(24) DEFAULT NULL COMMENT 'Print ISSN number for the title', - `online_issn` varchar(24) DEFAULT NULL COMMENT 'Online ISSN number for the title', - `title_uri` varchar(24) DEFAULT NULL COMMENT 'URI number for the title', + `title_doi` varchar(255) DEFAULT NULL COMMENT 'DOI number for the title', + `print_issn` varchar(255) DEFAULT NULL COMMENT 'Print ISSN number for the title', + `online_issn` varchar(255) DEFAULT NULL COMMENT 'Online ISSN number for the title', + `title_uri` varchar(255) DEFAULT NULL COMMENT 'URI number for the title', `publisher` varchar(255) DEFAULT NULL COMMENT 'Publisher for the title', - `publisher_id` varchar(24) DEFAULT NULL COMMENT 'Publisher ID for the title', - `yop` varchar(24) DEFAULT NULL COMMENT 'year of publication of the title', - `isbn` varchar(24) DEFAULT NULL COMMENT 'ISBN of the title', + `publisher_id` varchar(255) DEFAULT NULL COMMENT 'Publisher ID for the title', + `yop` varchar(255) DEFAULT NULL COMMENT 'year of publication of the title', + `isbn` varchar(255) DEFAULT NULL COMMENT 'ISBN of the title', PRIMARY KEY (`title_id`), CONSTRAINT `erm_usage_titles_ibfk_1` FOREIGN KEY (`usage_data_provider_id`) REFERENCES `erm_usage_data_providers` (`erm_usage_data_provider_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -133,7 +133,7 @@ return { `database` varchar(255) DEFAULT NULL COMMENT 'item title', `platform` varchar(255) DEFAULT NULL COMMENT 'database platform', `publisher` varchar(255) DEFAULT NULL COMMENT 'Publisher for the database', - `publisher_id` varchar(24) DEFAULT NULL COMMENT 'Publisher ID for the database', + `publisher_id` varchar(255) DEFAULT NULL COMMENT 'Publisher ID for the database', `usage_data_provider_id` int(11) NOT NULL COMMENT 'data provider the database is harvested by', PRIMARY KEY (`database_id`), CONSTRAINT `erm_usage_databases_ibfk_1` FOREIGN KEY (`usage_data_provider_id`) REFERENCES `erm_usage_data_providers` (`erm_usage_data_provider_id`) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index b4ce0c21a3..f45d9766d4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3205,16 +3205,16 @@ DROP TABLE IF EXISTS `erm_usage_titles`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `erm_usage_titles` ( `title_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', - `title` varchar(255) DEFAULT NULL COMMENT 'item title', + `title` mediumtext DEFAULT NULL COMMENT 'item title', `usage_data_provider_id` int(11) NOT NULL COMMENT 'platform the title is harvested by', - `title_doi` varchar(24) DEFAULT NULL COMMENT 'DOI number for the title', - `print_issn` varchar(24) DEFAULT NULL COMMENT 'Print ISSN number for the title', - `online_issn` varchar(24) DEFAULT NULL COMMENT 'Online ISSN number for the title', - `title_uri` varchar(24) DEFAULT NULL COMMENT 'URI number for the title', + `title_doi` varchar(255) DEFAULT NULL COMMENT 'DOI number for the title', + `print_issn` varchar(255) DEFAULT NULL COMMENT 'Print ISSN number for the title', + `online_issn` varchar(255) DEFAULT NULL COMMENT 'Online ISSN number for the title', + `title_uri` varchar(255) DEFAULT NULL COMMENT 'URI number for the title', `publisher` varchar(255) DEFAULT NULL COMMENT 'Publisher for the title', - `publisher_id` varchar(24) DEFAULT NULL COMMENT 'Publisher ID for the title', - `yop` varchar(24) DEFAULT NULL COMMENT 'year of publication of the title', - `isbn` varchar(24) DEFAULT NULL COMMENT 'ISBN of the title', + `publisher_id` varchar(255) DEFAULT NULL COMMENT 'Publisher ID for the title', + `yop` varchar(255) DEFAULT NULL COMMENT 'year of publication of the title', + `isbn` varchar(255) DEFAULT NULL COMMENT 'ISBN of the title', PRIMARY KEY (`title_id`), CONSTRAINT `erm_usage_titles_ibfk_1` FOREIGN KEY (`usage_data_provider_id`) REFERENCES `erm_usage_data_providers` (`erm_usage_data_provider_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -3248,7 +3248,7 @@ CREATE TABLE `erm_usage_databases` ( `database` varchar(255) DEFAULT NULL COMMENT 'item title', `platform` varchar(255) DEFAULT NULL COMMENT 'database platform', `publisher` varchar(255) DEFAULT NULL COMMENT 'Publisher for the database', - `publisher_id` varchar(24) DEFAULT NULL COMMENT 'Publisher ID for the database', + `publisher_id` varchar(255) DEFAULT NULL COMMENT 'Publisher ID for the database', `usage_data_provider_id` int(11) NOT NULL COMMENT 'data provider the database is harvested by', PRIMARY KEY (`database_id`), CONSTRAINT `erm_usage_databases_ibfk_1` FOREIGN KEY (`usage_data_provider_id`) REFERENCES `erm_usage_data_providers` (`erm_usage_data_provider_id`) ON DELETE CASCADE ON UPDATE CASCADE -- 2.39.2