<?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('penawaran_email_tender_log', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('penawaran_id');
            $table->foreign('penawaran_id')->references('id')->on('penawaran')->onDelete('cascade');
            $table->string('kjpp');
            $table->string('to_email');
            $table->string('subject');
            $table->text('body_pdf');
            $table->string('status');
            $table->text('error_message');
            $table->timestamps();
        });
    }

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