<?php

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

class CreateMallShopsTable extends Migration
{

    /**
     * Run the migrations.
     * @return void
     */
    public function up()
    {
        Schema::create('mall_shops', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('user_id')->index()->default(0);
            $table->string('name');
            $table->boolean('is_self')->unsigned()->default(0)->comment('是否自营');
            $table->string('description')->nullable();
            $table->string('mobile')->nullable();
            $table->string('cover')->nullable();
            $table->boolean('status')->default(0);
            $table->unsignedInteger('province_id')->index()->default(0);
            $table->unsignedInteger('city_id')->index()->default(0);
            $table->unsignedInteger('district_id')->index()->default(0);
            $table->string('address')->nullable();
            $table->json('configs')->nullable();
            $table->integer('order')->default(9999)->comment('排序用的，后台控制');
            $table->string('reject_reason')->comment('驳回原因')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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

}
