<?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::create('restaurant_order', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->comment("用户id");
            $table->string('trade_no', 50)->comment("订单号")->unique();
            $table->integer('status')->comment("支付状态 0 未支付,1:已支付,2:支付失败")->default(0);
            $table->integer('num')->comment("总份数");
            $table->decimal('price',7)->comment("支付金额")->default(0);
            $table->decimal('amount',7)->comment("实际支付金额")->default(0);
            $table->string('desc')->nullable()->comment("备注");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('restaurant_order');
    }
};
