From 9c46066352169a493c26a618ba7fc59c36228455 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 28 Oct 2021 12:11:07 +0000 Subject: [PATCH] Bug 29336: Database revision Content-Type: text/plain; charset=utf-8 Resizes the six fields identified earlier: additional_fields.authorised_value_category 16=>32 auth_subfield_structure.authorised_value 10=>32 auth_tag_structure.authorised_value 10=>32 club_template_enrollment_fields.authorised_value_category 16=>32 club_template_fields.authorised_value_category 16=>32 marc_tag_structure.authorised_value 10=>32 Test plan: Run dbrev, check database. Bonus: Connect an AV category with a long name to a authority subfield. Check if you see its values in the authority editor. (This was the way I found the problem.) Signed-off-by: Marcel de Rooy --- .../data/mysql/atomicupdate/bug_29336.pl | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_29336.pl diff --git a/installer/data/mysql/atomicupdate/bug_29336.pl b/installer/data/mysql/atomicupdate/bug_29336.pl new file mode 100755 index 0000000000..235ab117d6 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_29336.pl @@ -0,0 +1,21 @@ +use Modern::Perl; + +return { + bug_number => 29336, + description => "Resize authorised value category fields to 32 chars", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + my @sql_statements = ( + q|ALTER TABLE additional_fields CHANGE authorised_value_category authorised_value_category varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''|, + q|ALTER TABLE auth_subfield_structure CHANGE authorised_value authorised_value varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|, + q|ALTER TABLE auth_tag_structure CHANGE authorised_value authorised_value varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|, + q|ALTER TABLE club_template_enrollment_fields CHANGE authorised_value_category authorised_value_category varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|, + q|ALTER TABLE club_template_fields CHANGE authorised_value_category authorised_value_category varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|, + q|ALTER TABLE marc_tag_structure CHANGE authorised_value authorised_value varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|, + ); + foreach my $sql ( @sql_statements ) { + $dbh->do( $sql ); + } + }, +} -- 2.20.1