<?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('dns_zones', function (Blueprint $table) {
            $table->timestamp('suspended_at')->nullable()->after('is_active');
            $table->text('suspension_reason')->nullable()->after('suspended_at');
            $table->boolean('can_be_reactivated')->default(false)->after('suspension_reason');

            $table->index('suspended_at');
            $table->index('can_be_reactivated');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('dns_zones', function (Blueprint $table) {
            $table->dropIndex(['suspended_at']);
            $table->dropIndex(['can_be_reactivated']);
            $table->dropColumn(['suspended_at', 'suspension_reason', 'can_be_reactivated']);
        });
    }
};
