From 969ad3ece8c55563391f39280ddade70c74233cd Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 11 Apr 2019 13:39:10 +0000 Subject: [PATCH] Bug 19670: DBRev 18.11.05.002 Signed-off-by: Nick Clemens (cherry picked from commit f7869ad48b8f2f86f2b912aad1c3dcbd1a5679c1) Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_19670.perl | 13 ------------- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 14 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_19670.perl diff --git a/Koha.pm b/Koha.pm index 8c66463583..516fe165f1 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 = "18.11.04.001"; +$VERSION = "18.11.04.002"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_19670.perl b/installer/data/mysql/atomicupdate/bug_19670.perl deleted file mode 100644 index fbe9e911aa..0000000000 --- a/installer/data/mysql/atomicupdate/bug_19670.perl +++ /dev/null @@ -1,13 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - my $table_sth = $dbh->prepare('SHOW CREATE TABLE `search_marc_map`'); - $table_sth->execute(); - my @table = $table_sth->fetchrow_array(); - unless ( $table[1] =~ /`marc_field`.*COLLATE utf8mb4_bin/ ) { #catches utf8mb4 collated tables - $dbh->do("ALTER TABLE `search_marc_map` MODIFY `marc_field` VARCHAR(255) NOT NULL COLLATE utf8mb4_bin COMMENT 'the MARC specifier for this field'"); - } - - # Always end with this (adjust the bug info) - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 19670 - Change collation of marc_field to allow mixed case search field mappings)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b378f850ac..048276f093 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -17364,6 +17364,20 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 22607 - Set default value of issues.renewals to 0)\n"; } +$DBversion = '18.11.04.002'; +if( CheckVersion( $DBversion ) ) { + my $table_sth = $dbh->prepare('SHOW CREATE TABLE `search_marc_map`'); + $table_sth->execute(); + my @table = $table_sth->fetchrow_array(); + unless ( $table[1] =~ /`marc_field`.*COLLATE utf8mb4_bin/ ) { #catches utf8mb4 collated tables + $dbh->do("ALTER TABLE `search_marc_map` MODIFY `marc_field` VARCHAR(255) NOT NULL COLLATE utf8mb4_bin COMMENT 'the MARC specifier for this field'"); + } + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 19670 - Change collation of marc_field to allow mixed case search field mappings)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5