Bug 19670: Change Collation of marc_field to allow mixed case mappings
[koha.git] / installer / data / mysql / atomicupdate / bug_19670.perl
1 $DBversion = 'XXX'; # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
3     my $table_sth = $dbh->prepare('SHOW CREATE TABLE `search_marc_map`');
4     $table_sth->execute();
5     my @table = $table_sth->fetchrow_array();
6     unless ( $table[1] =~ /`marc_field`.*COLLATE utf8mb4_bin/ ) { #catches utf8mb4 collated tables
7         $dbh->do("ALTER TABLE `search_marc_map` MODIFY `marc_field` VARCHAR(255) NOT NULL COLLATE utf8mb4_bin COMMENT 'the MARC specifier for this field'");
8     }
9
10     # Always end with this (adjust the bug info)
11     SetVersion( $DBversion );
12         print "Upgrade to $DBversion done (Bug 19670 - Change collation of marc_field to allow mixed case search field mappings)\n";
13 }