<?php

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

class CreateSmsRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sms_records', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('user_id')->nullable()->comment('用户id');
            $table->string('event')->comment('事件 login register 等');
            $table->string('mobile')->comment('手机号');
            $table->string('verify_key')->comment('验证key  用于验证码校验');
            $table->string('sms_code')->comment('手机验证码');
            $table->text('sms_result')->nullable()->comment('短信发送回调');
            $table->timestamps();
        });
    }

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