<?php

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

return new class extends Migration
{
    /**
     * Plan-change invoices write a multi-line breakdown into the description
     * column (one line per affected option/custom field). The original
     * varchar(255) overflowed for upgrades touching 3+ options. TEXT is the
     * right type for human-readable, multi-line content.
     */
    public function up(): void
    {
        Schema::table('invoice_items', function (Blueprint $table) {
            $table->text('description')->change();
        });
    }

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