hauntd/yii2-vote

View on GitHub
migrations/Migration.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace hauntd\vote\migrations;

use Yii;

/**
 * @author Alexander Kononenko <contact@hauntd.me>
 * @package hauntd\vote\migrations
 * @property \hauntd\vote\Module $module
 */
class Migration extends \yii\db\Migration
{
    /**
     * @var string
     */
    protected $tableOptions;

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();
        $this->tableOptions = null;
        if (Yii::$app->db->driverName == 'mysql') {
            $this->tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }
    }
}