<?php

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

class m160228_111209_alter__table__discount__add__columns__product_on__ticket__on extends Migration
{
    public function up()
    {
    	$this->addColumn("discount", "product_enabled", "int default 0");
    	$this->addColumn("discount", "ticket_enabled", "int default 0");
    	
    	$this->execute("update discount set product_enabled = 1 , ticket_enabled = 1;");
    }

    public function down()
    {
        echo "m160228_111209_alter__table__discount__add__columns__product_on__ticket__on cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
