37 lines
631 B
PHP
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');
|
||
|
}
|
||
|
|
||
|
}
|