2

Creating MySQL table or adding columns with CakePHP3 migrations, charset is set to UTF8. Is there the way to set charset utf8mb4?

(and, i found this issue... https://github.com/robmorgan/phinx/issues/74)

1 Answers1

3

You can set the collation when you call the table() function.

public function change() {
     $table = $this->table('FooBar',['collation'=>'utf8mb4_unicode_ci']);
     //.....
}

You can only set the collation type. The character set will be extracted from that collation string. There for the above will have a character set of "utf8mb4".

Reactgular
  • 52,335
  • 19
  • 158
  • 208