<?php

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

/**
 * Class m231109_090026_add_column_producer_id_user_group_default
 */
class m231109_090026_add_column_producer_id_user_group_default extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('producer', 'id_user_group_default', Schema::TYPE_INTEGER);
        $this->addForeignKey('user_group_default_fk', 'producer', 'id_user_group_default', 'user_group', 'id');
    }

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