<?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 CreateWxUserAddressTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_user_address', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('wx_user_id')->comment('谁的收货地址');
            $table->string('name', 255)->comment('收货人姓名');
            $table->char('tel', 11)->comment('收货人电话');
            $table->string('area', 255)->comment('省市区地址');
            $table->string('address', 255)->nullable()->comment('详细地址');
            $table->string('status', 255)->comment('是否默认地址')->default(0);
            $table->nullableTimestamps();
            $table->softDeletes();

            $table->index('wx_user_id', 'wx_address_info_wx_user_id_foreign');

            

        });
    }

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