<?php

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

/**
 * Class m230904_064216_add_column_user_producer_newsletter
 */
class m230904_064216_add_column_user_producer_newsletter extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('user_producer', 'newsletter', Schema::TYPE_BOOLEAN);
        $this->execute('UPDATE user_producer SET newsletter = 1;');
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn('user_producer', 'newsletter');
    }
}
