<?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('evidence_custody_events', function (Blueprint $table) {
            $table->id();
            $table->foreignId('evidence_id')->constrained('evidences');
            $table->enum('event_type', ['created','uploaded','viewed','downloaded','transferred','exported','archived']);
            $table->foreignId('performed_by')->nullable()->constrained('users');
            $table->dateTime('event_at');
            $table->text('notes')->nullable();
            $table->string('ip_address', 45)->nullable();
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('evidence_custody_events'); }
};
