<?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('guard_shifts', function (Blueprint $table) {
            $table->id();
            $table->foreignId('guard_id')->constrained('users')->onDelete('cascade');
            $table->string('shift_type'); // ej: Diurno, Nocturno, 24x24, 4x4
            $table->timestamp('started_at');
            $table->timestamp('ended_at')->nullable();
            $table->timestamps();
        });
    }

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