<?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_refund', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->comment("用户id");
            $table->integer('restaurant_id')->comment("退款订餐id");
            $table->string('trade_no', 50)->comment("订单号");
            $table->string('refund_trade_no', 50)->comment("退款订单号");
            $table->integer('status')->comment("退款状态 0 发起退款,1:已退款,2:退款失败")->default(0);
            $table->decimal('total_amount',7)->comment("订单总金额")->default(0);
            $table->decimal('refund_amount',7)->comment("实际退款金额")->default(0);
            $table->string('desc')->nullable()->comment("备注");
            $table->timestamps();
        });
    }

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