From 4ac79eb616250f9a89c0f1583d641b7975ef637b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 24 Jul 2014 10:27:08 +0200 Subject: [PATCH] Bug 11944: Convert DB tables to utf8_unicode_ci --- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 94bb4ff..a804e0c 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8577,6 +8577,20 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.17.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q|SET foreign_key_checks = 0|);; + my @tables = $dbh->tables(); + for my $table ( @tables ) { + warn $table; + $dbh->do(qq|ALTER TABLE $table CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci|); + } + $dbh->do(q|SET foreign_key_checks = 1|);; + + print "Upgrade to $DBversion done (Bug 11944 - Convert DB tables to utf8_unicode_ci)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 2.0.0.rc2