<?php

use yii\db\Schema;
use yii\db\Migration;

class m160126_110636_fix_review_table extends Migration
{
    public function safeUp()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') 
        {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
        }

        $this->addColumn('reviews', 'video', Schema::TYPE_STRING . '(255) AFTER `photo`');
    }

    public function safeDown()
    {
        $this->dropColumn('reviews', 'video');
    }
}
