<?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('rate_limit_settings', function (Blueprint $table) {
            $table->id();
            $table->string('endpoint')->nullable()->unique();
            $table->unsignedInteger('max_attempts')->default(100);
            $table->unsignedInteger('decay_seconds')->default(60);
            $table->boolean('is_enabled')->default(true);
            $table->string('description')->nullable();
            $table->timestamps();
        });
    }

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