<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ChengeDecimalPriceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('prices', function (Blueprint $table) {
            if (Schema::hasColumn('prices', 'min_price')) {
                $table->decimal('min_price', 11, 2)->nullable()->change();
            }

            if (Schema::hasColumn('prices', 'max_price')) {
                $table->decimal('max_price', 11, 2)->nullable()->change();
            }
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
