<?php

use yii\db\Migration;

class m160226_101540_update_schedule_tinyint_columns extends Migration
{
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
        $this->alterColumn(
            'trigger_schedule',
            'sended',
            $this->integer(1)->defaultValue(0)->notNull()
        );
        $this->alterColumn(
            'trigger_schedule',
            'checked',
            $this->integer(1)->defaultValue(0)->notNull()
        );
    }

    public function safeDown()
    {
        $this->alterColumn(
            'trigger_schedule',
            'sended',
            $this->smallInteger(1)->defaultValue(0)->notNull()
        );
        $this->alterColumn(
            'trigger_schedule',
            'checked',
            $this->smallInteger(1)->defaultValue(0)->notNull()
        );
    }
}
