<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
 * Accounts — cPanel-grade skeleton fields.
 *
 * - linux_gid: provision sonrası set edilir (primary group)
 * - skeleton_version: hangi skeleton template versiyonu uygulandı (drift detect)
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::table('accounts', function (Blueprint $table) {
            $table->unsignedInteger('linux_gid')->nullable()->after('linux_uid')
                ->comment('Primary group GID; user-add cikti gid alanindan set edilir');
            $table->string('skeleton_version', 8)->nullable()->after('linux_gid')
                ->comment('cPanel-grade skeleton template versiyonu (drift detect)');
        });
    }

    public function down(): void
    {
        Schema::table('accounts', function (Blueprint $table) {
            $table->dropColumn(['linux_gid', 'skeleton_version']);
        });
    }
};
