<?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('websites', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('domain')->unique();
            $table->enum('tier', ['basic', 'standard', 'premium'])->default('basic');
            $table->json('tier_fields')->nullable();
            $table->integer('cache_hit_rate_limit')->default(100);
            $table->integer('external_api_rate_limit')->default(10);
            $table->boolean('is_active')->default(true);
            $table->boolean('bypass_rate_limit')->default(false);
            $table->timestamps();
        });
    }

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