<?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::table('license_domains', function (Blueprint $table) {
            $table->string('website_status')
                  ->default('unknown')
                  ->after('domain');
            $table->timestamp('last_checked_at')
                  ->nullable()
                  ->after('website_status');

            $table->integer('last_response_time')
                  ->nullable()
                  ->after('last_checked_at');

            $table->unsignedBigInteger('monitor_id')
                  ->nullable()
                  ->after('last_response_time');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('license_domains', function (Blueprint $table) {
            $table->dropColumn([
                'website_status',
                'last_checked_at',
                'last_response_time',
                'monitor_id',
            ]);
        });
    }
};
