<?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('episode_skip_events', function (Blueprint $table) {
            $table->id();
            $table->foreignId('episode_id')->constrained()->cascadeOnDelete();
            $table->unsignedInteger('from_sec');  // seek FROM
            $table->unsignedInteger('to_sec');    // seek TO
            $table->timestamp('created_at')->useCurrent();
            $table->index(['episode_id', 'from_sec']);
        });
    }

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