From c5ebd85755429ac8b3b64b41ed2f1d6474749e5b Mon Sep 17 00:00:00 2001 From: Andrew Fuerste-Henry Date: Wed, 16 Feb 2022 16:50:09 +0000 Subject: [PATCH] Bug 29336: DBRev 21.05.10.001 Signed-off-by: Andrew Fuerste-Henry --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_29336.pl | 21 ------------------- installer/data/mysql/updatedatabase.pl | 11 ++++++++++ 3 files changed, 12 insertions(+), 22 deletions(-) delete mode 100755 installer/data/mysql/atomicupdate/bug_29336.pl diff --git a/Koha.pm b/Koha.pm index 9cd95c8dd2..d34ae46225 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "21.05.10.000"; +$VERSION = "21.05.10.001"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_29336.pl b/installer/data/mysql/atomicupdate/bug_29336.pl deleted file mode 100755 index 235ab117d6..0000000000 --- a/installer/data/mysql/atomicupdate/bug_29336.pl +++ /dev/null @@ -1,21 +0,0 @@ -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 ); - } - }, -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 9048d0aba3..f9c27549ac 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -24581,6 +24581,17 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, "", "Koha 21.05.10 release" ); } +$DBversion = '21.05.10.001'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q|ALTER TABLE additional_fields CHANGE authorised_value_category authorised_value_category varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''|); + $dbh->do(q|ALTER TABLE auth_subfield_structure CHANGE authorised_value authorised_value varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|); + $dbh->do(q|ALTER TABLE auth_tag_structure CHANGE authorised_value authorised_value varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|); + $dbh->do(q|ALTER TABLE club_template_enrollment_fields CHANGE authorised_value_category authorised_value_category varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|); + $dbh->do(q|ALTER TABLE club_template_fields CHANGE authorised_value_category authorised_value_category varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|); + $dbh->do(q|ALTER TABLE marc_tag_structure CHANGE authorised_value authorised_value varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL|); + NewVersion( $DBversion, 29336, "Resize authorised value category fields to 32 chars"); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5