function endCreateTable($name, array $def)
{
$engine = $this->preferredEngine($def);
- return ") ENGINE=$engine CHARACTER SET utf8 COLLATE utf8_bin";
+ return ") ENGINE=$engine CHARACTER SET utf8mb4 COLLATE utf8mb4_bin";
}
function preferredEngine($def)
return "{$tableName}_{$columnName}_idx";
}
+ /**
+ * MySQL doesn't take 'DROP CONSTRAINT', need to treat primary keys as
+ * if they were indexes here, but can use 'PRIMARY KEY' special name.
+ *
+ * @param array $phrase
+ */
+ function appendAlterDropPrimary(array &$phrase)
+ {
+ $phrase[] = 'DROP PRIMARY KEY';
+ }
/**
* MySQL doesn't take 'DROP CONSTRAINT', need to treat unique keys as
if (strtolower($oldProps['ENGINE']) != strtolower($engine)) {
$phrase[] = "ENGINE=$engine";
}
- if (strtolower($oldProps['TABLE_COLLATION']) != 'utf8_bin') {
- $phrase[] = 'DEFAULT CHARSET=utf8';
- $phrase[] = 'COLLATE=utf8_bin';
+ if (strtolower($oldProps['TABLE_COLLATION']) != 'utf8mb4_bin') {
+ $phrase[] = 'CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin';
+ $phrase[] = 'DEFAULT CHARACTER SET = utf8mb4';
+ $phrase[] = 'DEFAULT COLLATE = utf8mb4_bin';
}
}