<?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('rfqs', function (Blueprint $table) {
            $table->id();
            $table->foreignId('buyer_id')->constrained('buyers')->onDelete('cascade');
            $table->string('title');
            $table->text('description');
            $table->string('category'); // Or foreign key to categories? Prompt said 'category', keeping as string or could be ID. Let's assume string for flexibility or ID if strict. Prompt: "category".
            $table->decimal('budget', 10, 2)->nullable();
            $table->string('status')->default('open'); // open, closed, awarded
            $table->timestamps();
        });
    }

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