<?php

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

class CreateUserWechatsTable extends Migration
{

    /**
     * Run the migrations.
     * @return void
     */
    public function up()
    {
        Schema::create('user_wechats', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id');
            $table->string('unionid')->comment('unionid')->nullable();
            $table->string('nickname')->comment('微信昵称')->nullable();
            $table->string('avatar')->comment('微信头像')->nullable();
            $table->boolean('sex')->comment('性别')->default(0);
            $table->string('country')->nullable();
            $table->string('province')->nullable();
            $table->string('city')->nullable();
            $table->timestamps();
        });
    }

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

}
