photo/database/migrations/2017_07_03_155604_create_tag_video_table.php

38 lines
569 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTagVideoTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tag_video', function(Blueprint $table)
{
$table->id();
$table->timestamps();
$table->bigInteger('video_id');
$table->bigInteger('tag_id');
$table->unique(['video_id','tag_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tag_video');
}
}