<?php

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

class CreatePaymentTransfersTable extends Migration
{

    /**
     * Run the migrations.
     * @return void
     */
    public function up()
    {
        Schema::create('payment_transfers', function (Blueprint $table) {
            $table->id();
            $table->uuid('transfer_no')->index()->comment('商户订单号');
            $table->decimal('amount')->comment('转账金额');
            $table->enum('driver', ['alipay', 'wechat'])->index()->comment('付款渠道');
            $table->string('to')->index()->comment('微信openid，支付宝identity');
            $table->boolean('check')->default(0)->comment('是否校验真实姓名');
            $table->string('user_name')->nullable()->comment('收款人姓名');
            $table->string('desc')->nullable()->comment('付款说明');
            $table->string('status', 16)->nullable()->comment('转账状态');
            $table->timestamps();
            $table->softDeletes();
        });
    }

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

}
