photo/database/migrations/2017_07_03_155604_create_person_video_table.php

37 lines
631 B
PHP

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