<?php

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

class CreateUserSmsConfigsTable extends Migration
{

    /**
     * Run the migrations.
     * @return void
     */
    public function up()
    {
        Schema::create('user_sms_configs', function (Blueprint $table) {
            $table->id();
            $table->boolean('debug')->default(1);
            $table->string('debug_code', 16);
            $table->tinyInteger('length')->default(4);
            $table->tinyInteger('expires')->default(5)->comment('有效期，单位：分钟');
            $table->json('template')->nullable();
            $table->string('default_gateway', 16);
            $table->boolean('in_use')->default(0);
            $table->timestamps();
        });
    }

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

}