<?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('url_to_crawls', function (Blueprint $table) {
            $table->id();
            $table->string('domain');
            $table->string('url');
            $table->boolean('is_crawling')->default(false);
            $table->boolean('is_crawled')->default(false);
            $table->enum('output_type', ['html', 'markdown', 'file'])->nullable();
            $table->text('output')->nullable();
            $table->json('metadata')->nullable();
            $table->enum('status', ['initial', 'complete', 'blocked', 'trashed'])->default('initial');
            $table->timestamps();
        });
    }

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