db->driverName === 'mysql') { $tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=InnoDB'; } $this->createTable( '{{%settings}}', [ //'id' => $this->primaryKey(), 'section' => $this->string(), 'key' => $this->string(), 'type' => $this->string()->notNull(), 'active' => $this->integer(1), 'created_at' => $this->integer()->unsigned(), 'updated_at' => $this->integer()->unsigned(), ], $tableOptions ); $this->addPrimaryKey('idx_setting_key', '{{%settings}}', ['section', 'key']); //$this->createIndex('idx_setting_key', '{{%settings}}', ['section', 'key']); } /** * @inheritdoc */ public function down() { //$this->dropIndex('idx_setting_key', '{{%settings}}'); $this->dropTable('{{%settings}}'); } }