MangaDex/database/migrations/2023_08_23_115026_create_chapters_table.php
2023-09-13 02:33:26 +06:30

34 lines
803 B
PHP

<?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('chapters', function (Blueprint $table) {
$table->id();
$table->string('title')->nullable();
$table->unsignedInteger('chapter_no')->nullable();
$table->json('images');
$table->foreignId('manga_id')->constrained()->onDelete('cascade');
$table->foreignId('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('chapters');
}
};