<?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('users', function (Blueprint $table) {
            $table->unsignedInteger('override_days_to_suspend')->nullable()->after('virtfusion_user_id');
            $table->unsignedInteger('override_days_to_terminate')->nullable()->after('override_days_to_suspend');
            $table->decimal('credit_balance', 10, 2)->default(0)->after('override_days_to_terminate');
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn([
                'override_days_to_suspend',
                'override_days_to_terminate',
                'credit_balance',
            ]);
        });
    }
};
