<?php

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

class CreateMessagesTagRelationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('messages_tag_relation', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('site_id')->nullable()->comment('站点ID');
            $table->integer('messages_id')->comment('信息ID');
            $table->integer('tag_id')->comment('标签ID');

            $table->softDeletes();
            $table->timestamps();
        });
    }

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