From ae481fde83f1811cc8204d552c37562e26e840c9 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 23 Apr 2019 13:51:49 +0000 Subject: [PATCH] Bug 19670: DBRev 18.05.11.002 Signed-off-by: Lucas Gass --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_19670.perl | 13 ------------- installer/data/mysql/updatedatabase.pl | 14 +++++++++++++- 3 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_19670.perl diff --git a/Koha.pm b/Koha.pm index 14cc8d2539..d41f636741 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.05.11.001"; +$VERSION = "18.05.11.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 914392a72a..bd8b86856e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -16351,11 +16351,23 @@ if( CheckVersion( $DBversion ) ) { $dbh->do( "ALTER TABLE issues MODIFY COLUMN renewals tinyint(4) NOT NULL default 0"); $dbh->do( "ALTER TABLE old_issues MODIFY COLUMN renewals tinyint(4) NOT NULL default 0"); - # Always end with this (adjust the bug info) SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 22607 - Set default value of issues.renewals to 0)\n"; } +$DBversion = '18.05.11.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'"); + } + + 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.20.1