<?php

use domain\Producer\Producer\Producer;
use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m230726_105750_producer_alter_option_display_message_new_opendistrib_version
 */
class m230726_105750_producer_alter_option_display_message_new_opendistrib_version extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->alterColumn('producer', 'option_display_message_new_opendistrib_version', Schema::TYPE_BOOLEAN.' DEFAULT 0');
        Producer::updateAll(['option_display_message_new_opendistrib_version' => 0]);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->alterColumn('producer', 'option_display_message_new_opendistrib_version', Schema::TYPE_BOOLEAN.' DEFAULT 1');
    }
}
