<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('food', function (Blueprint $table) {
            $table->string('area',32)->nullable()->comment('地区 大陆:mainland 港澳台:hmt')->default('mainland')->after('id');
            $table->decimal('price', 7,2)->nullable()->comment('价格')->default(0)->after('unit');
            $table->boolean('have_goods')->nullable()->comment("是否有货，0：否，1：是")->default(1)->after('unit');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('food', function (Blueprint $table) {
            $table->dropColumn(['price']);
            $table->dropColumn(['area']);
            $table->dropColumn(['have_goods']);
        });
    }
};
