<?php

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

return new class extends Migration {
    public function up()
    {
        if (Schema::hasTable('groups') && !Schema::hasColumn('groups', 'description')) {
            Schema::table('groups', function (Blueprint $table) {
                $table->string('description')->nullable();
            });
        }
    }

    public function down()
    {
        if (Schema::hasTable('groups') && Schema::hasColumn('groups', 'description')) {
            Schema::table('groups', function (Blueprint $table) {
                $table->dropColumn('description');
            });
        }
    }
}; 