<?php

declare(strict_types=1);

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::table('plans', function (Blueprint $table) {
            $table->unsignedInteger('days_to_suspend')->nullable()->after('sort_order');
            $table->unsignedInteger('days_to_terminate')->nullable()->after('days_to_suspend');
            $table->boolean('auto_suspend_enabled')->default(true)->after('days_to_terminate');
            $table->boolean('auto_terminate_enabled')->default(true)->after('auto_suspend_enabled');
        });
    }

    public function down(): void
    {
        Schema::table('plans', function (Blueprint $table) {
            $table->dropColumn([
                'days_to_suspend',
                'days_to_terminate',
                'auto_suspend_enabled',
                'auto_terminate_enabled',
            ]);
        });
    }
};
