<?php

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

/**
 * Class m240424_071154_add_columns_point_sale_payment_method
 */
class m240424_071154_add_columns_point_sale_payment_method extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('point_sale', 'payment_method_onsite', Schema::TYPE_BOOLEAN);
        $this->addColumn('point_sale', 'payment_method_online', Schema::TYPE_BOOLEAN);
        $this->renameColumn('point_sale', 'credit', 'payment_method_credit');
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn('point_sale', 'payment_method_onsite');
        $this->dropColumn('point_sale', 'payment_method_online');
        $this->renameColumn('point_sale', 'payment_method_credit', 'credit');
    }
}
