From 127c2cf60173742576637ab33ddb3622338c1384 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 7 Oct 2022 19:24:46 +0000 Subject: [PATCH] Bug 31716: Enlarge the authorised_value column in authorised_values This patch changes authorised_value from VARCHAR(80) to VARCHAR(255) To test: 1 - Apply patch 2 - Update database 3 - Confirm you can store a longer value in authorised_values Signed-off-by: David Nind --- .../atomicupdate/bug_31716_enlarge_av_column.pl | 16 ++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- .../prog/en/modules/admin/authorised_values.tt | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) 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 7025f9bbf9..162e5213a3 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -941,7 +941,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', diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt index 3aedceb814..73e657d246 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -20,6 +20,7 @@ padding-bottom: 0; width: auto; } + #authorised_value, #lib, #lib_opac { width: 75%; @@ -140,7 +141,7 @@ [% IF ( action_modify ) %] [% END %] - +
  • -- 2.30.2