<?php

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

/**
 * Migration auto-generated by Sequel Pro Laravel Export
 * @see https://github.com/cviebrock/sequel-pro-laravel-export
 */
class CreateUserInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_info', function (Blueprint $table) {
            $table->increments('id')->comment('用户ID');
            $table->char('nickname', 64)->nullable()->comment('微信昵称');
            $table->char('openid', 64)->nullable()->comment('微信openid');
            $table->char('mobile', 11)->comment('手机号');
            $table->string('avatar', 255)->comment('用户头像');
            $table->dateTime('last_login_time')->nullable()->comment('最后一次登录时间');
            $table->string('remember_token', 255)->nullable();
            $table->timestamps();
            $table->softDeletes();
            $table->index('deleted_at', 'idx_deleted_at');
        });
    }

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