<?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('radios', function (Blueprint $table) {
            $table->id();
            $table->string('title', 255); 
            $table->foreignId('radio_category_id')->constrained('radio_categories')->onDelete('cascade');
            $table->string('thumbnail_image');
            $table->enum('video_type', ['upload', 'youtube', 'radio', 'other'])->comment('upload: video file, youtube: YouTube URL, radio: Radio URL, other: other URL');
            $table->string('youtube_url', 255)->nullable(); 
            $table->string('radio_url', 255)->nullable(); 
            $table->string('other_url', 255)->nullable(); 
            $table->string('video', 255)->nullable(); 
            $table->text('description'); 
            $table->integer('total_views')->default(0);
            $table->boolean('is_slider')->default(false);
            $table->unsignedTinyInteger('status')->default(0)->nullable()->comment('0: active, 1: inactive');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('radios');
    }
};
