<?php

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

class m170104_054306_alter__table__product__set_products__tax__18 extends Migration
{
    public function up()
    {
        $this->execute("update product set tax = 18 where name = 'Zabcsók';");
        $this->execute("update product set tax = 18 where name = 'Mabaker zabszelet';");
        $this->execute("update product set purchase_net_price = purchase_price -  FLOOR( purchase_price * tax / 100 )");
    }

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

        return false;
    }

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

    public function safeDown()
    {
    }
    */
}
