<?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('alerts', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->onDelete('cascade');
            $table->decimal('latitude', 10, 8);
            $table->decimal('longitude', 11, 8);
            $table->enum('status', ['active', 'investigating', 'resolved'])->default('active');
            $table->string('video_path')->nullable();
            $table->timestamp('tagged_at');
            $table->timestamps();
        });
    }

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