<?php

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

class CreateMallGoodsTagTable extends Migration
{

    /**
     * Run the migrations.
     * @return void
     */
    public function up()
    {
        Schema::create('mall_goods_tag', function (Blueprint $table) {
            $table->unsignedBigInteger('goods_id')->index();
            $table->unsignedBigInteger('tag_id')->index();
            $table->timestamps();

            $table->primary(['goods_id', 'tag_id']);
        });
    }

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

}