From b1fd779bec8b34507cdae8ff27909f5cd42eb66b Mon Sep 17 00:00:00 2001 From: Alex Prokopenko Date: Sat, 13 Jul 2019 14:57:30 +0300 Subject: [PATCH] Fix issue #1 - set innoDB engine for mysql --- migrations/m170913_142352_create_settings_table.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/migrations/m170913_142352_create_settings_table.php b/migrations/m170913_142352_create_settings_table.php index 5f16e21..8b2ed98 100644 --- a/migrations/m170913_142352_create_settings_table.php +++ b/migrations/m170913_142352_create_settings_table.php @@ -12,11 +12,17 @@ class m170913_142352_create_settings_table extends Migration */ public function up() { + $tableOptions = null; + if ($this->db->driverName === 'mysql') { + // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci. + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; + } + $this->createTable('settings', [ 'section_name' => $this->string()->notNull(), 'key' => $this->string()->notNull(), 'value' => $this->binary(), - ]); + ], $tableOptions); $this->addPrimaryKey('settings_pk', 'settings', ['section_name', 'key']); }