<?php

use yii\db\Migration;

/**
 * Class m230825_090016_active_user_producer_with_credit_positive_or_negative
 */
class m230825_090016_active_user_producer_with_credit_positive_or_negative extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->execute('UPDATE user_producer SET active = 1 WHERE credit IS NOT NULL AND (credit < 0 OR credit > 0);');
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m230825_090016_active_user_producer_with_credit_positive_or_negative cannot be reverted.\n";

        return false;
    }
}
