<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('utility_fee_attachments', function (Blueprint $table) {
            $table->id();
            $table->foreignId('utility_fee_id')->constrained('utility_fees')->cascadeOnDelete();
            $table->string('file_path');          // 儲存路徑
            $table->string('original_name');      // 原始檔名
            $table->string('mime_type');          // MIME 類型
            $table->unsignedBigInteger('size');   // 檔案大小 (bytes)
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('utility_fee_attachments');
    }
};
