Change the row-format before changing the collation

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-01-12 16:54:29 +01:00
parent fc2a2c3ee9
commit b7117d0b10
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 12 additions and 0 deletions

View File

@ -75,6 +75,18 @@ class Collation implements IRepairStep {
$tables = $this->getAllNonUTF8BinTables($this->connection);
foreach ($tables as $table) {
$output->info("Change row format for $table ...");
$query = $this->connection->prepare('ALTER TABLE `' . $table . '` ROW_FORMAT = DYNAMIC;');
try {
$query->execute();
} catch (DriverException $e) {
// Just log this
$this->logger->logException($e);
if (!$this->ignoreFailures) {
throw $e;
}
}
$output->info("Change collation for $table ...");
$query = $this->connection->prepare('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET ' . $characterSet . ' COLLATE ' . $characterSet . '_bin;');
try {