<?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('s2_shop_order_refund', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->comment("用户id");
            $table->integer('order_id')->comment("订单id");
            $table->string('trade_no')->comment("订单号");
            $table->string('refund_trade_no')->comment("退款订单号");
            $table->tinyInteger('status')->default(1)->comment("状态 1:申请退款 2:审核通过(退款成功) 3:审核拒绝(退款失败)");
            $table->bigInteger('total_amount')->comment("订单总金额,单位分");
            $table->bigInteger('refund_amount')->comment("退款总金额,单位分");
            $table->string('remark')->nullable()->comment("备注信息");
            $table->timestamps();
        });
    }

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