<?php

use yii\db\Migration;

class m160316_125140_set_default_value_to_trigger_column_in_schedule_table extends Migration
{
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
        $this->alterColumn(
            'trigger_schedule',
            'trigger_id',
            $this->integer(11)->defaultValue(null)
        );
    }

    public function safeDown()
    {
        $this->alterColumn(
            'trigger_schedule',
            'trigger_id',
            $this->integer(11)->notNull()
        );
    }
}
