<?php

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

/**
 * PRC-593: ticket_department_mailboxes.password artık `encrypted` cast ile
 * saklanıyor. Encrypted (Crypt) payload base64 olarak ~200-260+ karakter →
 * varchar(255) taşabilir; TEXT'e çekiyoruz.
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::table('ticket_department_mailboxes', function (Blueprint $table) {
            $table->text('password')->nullable()->change();
        });
    }

    public function down(): void
    {
        Schema::table('ticket_department_mailboxes', function (Blueprint $table) {
            $table->string('password', 255)->nullable()->change();
        });
    }
};
