<?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 CreateWxUserInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_user_info', function (Blueprint $table) {
            $table->increments('id')->comment('用户ID');
            $table->string('appid')->comment('appid')->default(0);
            $table->string('nickname', 255)->nullable()->comment('微信昵称');
            $table->string('openid', 255)->comment('openid');
            $table->string('avatar', 255)->nullable()->comment('头像');
            $table->string('password', 255)->nullable()->comment('密码');
            $table->integer('score')->comment('积分');
            $table->integer('level_id')->default(1)->comment('会员等级');
            $table->string('balance', 255)->comment('余额');
            $table->string('remark', 255)->nullable()->comment('备注');
            $table->unsignedTinyInteger('status')->default(1);
            $table->nullableTimestamps();
            $table->softDeletes();

            $table->index('level_id', 'wx_user_info_level_id_foreign');

            

        });
    }

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