From 7c03ab60bdb82ac7cd72233dae70d69d07916f43 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 7 Oct 2022 19:24:46 +0000 Subject: [PATCH] Bug 31716: Enlagre the authorised_value column in authorised_values To test: 1 - Apply patch 2 - Update database 3 - Confirm you can store a longer value in authorised_values --- .../atomicupdate/bug_31716_enlarge_av_column.pl | 16 ++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_31716_enlarge_av_column.pl diff --git a/installer/data/mysql/atomicupdate/bug_31716_enlarge_av_column.pl b/installer/data/mysql/atomicupdate/bug_31716_enlarge_av_column.pl new file mode 100755 index 0000000000..3e00083bb1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_31716_enlarge_av_column.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "31716", + description => "Enlarge the size of the authorised_value column in authorised_values", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Do you stuffs here + $dbh->do(q{ + ALTER TABLE authorised_values MODIFY COLUMN authorised_value varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'code use to identify the authorized value'; + }); + # Print useful stuff here + say $out "Column enlarged"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 1461ad436c..2a43c21696 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -990,7 +990,7 @@ DROP TABLE IF EXISTS `authorised_values`; CREATE TABLE `authorised_values` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key, used to identify the authorized value', `category` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'key used to identify the authorized value category', - `authorised_value` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'code use to identify the authorized value', + `authorised_value` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'code use to identify the authorized value', `lib` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value description as printed in the staff interface', `lib_opac` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value description as printed in the OPAC', `imageurl` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value URL', -- 2.30.2