<?php

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::create('contact_message_attachments', function (Blueprint $t) {
            $t->id();
            $t->foreignId('contact_message_id')->constrained()->cascadeOnDelete();
            $t->string('disk', 32);
            $t->string('path');
            $t->string('filename');
            $t->string('mime', 128)->nullable();
            $t->unsignedBigInteger('size')->nullable();
            $t->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('contact_message_attachments');
    }
};
