photo/database/migrations/2016_06_03_055604_create_photo_people_table.php
2016-06-22 16:53:48 +10:00

37 lines
631 B
PHP

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