MangaDex/database/migrations/2023_09_13_132221_create_comments_table.php

31 lines
729 B
PHP
Raw Normal View History

2023-09-20 21:19:28 +06:30
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('comments', function (Blueprint $table) {
$table->id();
$table->longText('comment');
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->foreignId('chapter_id')->constrained()->cascadeOnDelete();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('comments');
}
};