<?php

use yii\db\Migration;
use yii\db\Schema;
use common\logic\Producer\Producer\Model\Producer;

/**
 * Class m220915_083713_producer_add_options_billing
 */
class m220915_083713_producer_add_options_billing extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('producer', 'option_billing_type', Schema::TYPE_STRING.' DEFAULT \''.Producer::BILLING_TYPE_CLASSIC.'\'');
        $this->addColumn('producer', 'option_billing_reduction', Schema::TYPE_BOOLEAN.' DEFAULT 0');
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn('producer','option_billing_type');
        $this->dropColumn('producer','option_billing_reduction');
    }
}
