Files
opensem/database/migrations/2021_05_21_001707_create_comments_table.php
Ludovic CANDELLIER b50f50ea62 [WIP] Refactor project
2021-05-21 00:21:05 +02:00

31 lines
743 B
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCommentsTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('comments', function (Blueprint $table) {
$table->increments('id');
$table->morphs('commentable');
$table->text('comment');
$table->boolean('is_approved')->default(false);
$table->unsignedBigInteger('user_id')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::dropIfExists('comments');
}
}