<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('series', function (Blueprint $table) {
            $table->id();
            $table->string('title', 255);
            $table->foreignId('category_id')->constrained()->onDelete('cascade');
            $table->string('thumbnail_image');
            $table->text('description')->nullable();
            $table->integer('total_views')->default(0);
            $table->unsignedTinyInteger('status')->default(0)->comment('0: active, 1: inactive');
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('series');
    }
};
