39 lignes
1 007 o
PHP
39 lignes
1 007 o
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
class CreateCommentTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('profile_comment', function (Blueprint $table) {
|
||
|
$table->increments('id');
|
||
|
$table->string('content',500);
|
||
|
$table->integer('creator_id');
|
||
|
$table->integer('profile_id');
|
||
|
$table->integer('creation_date');
|
||
|
$table->integer('modification_date');
|
||
|
$table->unique(['creator_id', 'profile_id']);
|
||
|
$table->foreign('profile_id')->references('id')->on('profile');
|
||
|
$table->foreign('creator_id')->references('id')->on('users');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('profile_comment');
|
||
|
}
|
||
|
}
|