<?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->integer('site_id')->nullable()->comment('站点ID');
            $table->char('nickname', 64)->nullable()->comment('微信昵称');
            $table->char('username', 64)->nullable()->comment('用户名');
            $table->string('email', 100)->comment('EMAIL');
            $table->char('mobile', 11)->comment('手机号');
            $table->string('avatar', 255)->comment('用户头像');
            $table->string('openid', 255)->comment('微信openid');
            $table->integer('grade')->nullable()->comment('成绩');
            $table->string('cnumber',64)->nullable()->comment('考号');
            $table->string('class',64)->nullable()->comment('科类');
            $table->integer('refer_id')->nullable()->comment('推荐人ID');
            $table->string('code',255)->nullable()->comment('推荐码');
            $table->string('paid_end_time', 255)->nullable()->comment('付费查询有效期');
            $table->dateTime('last_login_time')->nullable()->comment('最后一次登录时间');
            $table->tinyInteger('has_agreed')->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');
    }
}
