<?php

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

/**
 * Class m240206_135558_add_columns_producer_tiller_api_v3
 */
class m240206_135558_add_columns_producer_tiller_api_v3 extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('producer', 'tiller_api_version', Schema::TYPE_STRING.' DEFAULT \'v3\'');
        $this->addColumn('producer', 'tiller_client_id', Schema::TYPE_STRING);
        $this->addColumn('producer', 'tiller_client_secret', Schema::TYPE_STRING);
        $this->addColumn('producer', 'tiller_access_token', Schema::TYPE_TEXT);
        $this->addColumn('producer', 'tiller_refresh_token', Schema::TYPE_TEXT);
        $this->addColumn('producer', 'tiller_redirect_uri', Schema::TYPE_STRING);
        $this->addColumn('producer', 'tiller_store_id', Schema::TYPE_STRING);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn('producer', 'tiller_api_version');
        $this->dropColumn('producer', 'tiller_client_id');
        $this->dropColumn('producer', 'tiller_client_secret');
        $this->dropColumn('producer', 'tiller_access_token');
        $this->dropColumn('producer', 'tiller_refresh_token');
        $this->dropColumn('producer', 'tiller_redirect_uri');
        $this->dropColumn('producer', 'tiller_store_id');
    }
}
