<?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('payment_webhook_processed_logs', function (Blueprint $table) {
            $table->id();
            $table->enum('provider', ['stripe']);
            $table->string('log_id');
            $table->enum('log_type', ['checkout_session']);
            $table->timestamps();

            $table->index(['log_id', 'log_type', 'provider'], 'idx_webhook_logs_search');
        });
    }

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