<?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('mailing_messaggi', function (Blueprint $table) {
            $table->json('log_falliti')->nullable()->after('invii_falliti');
            $table->string('mittente_nome')->nullable()->after('log_falliti');
            $table->string('mittente_email')->nullable()->after('mittente_nome');
        });
    }

    public function down(): void
    {
        Schema::table('mailing_messaggi', function (Blueprint $table) {
            $table->dropColumn(['log_falliti', 'mittente_nome', 'mittente_email']);
        });
    }
};
