<?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('alumno_promocion', function (Blueprint $table) {
            $table->id();
            $table->foreignId('alumno_id')->constrained('alumnos')->cascadeOnDelete();
            $table->foreignId('promocion_id')->constrained('promociones')->cascadeOnDelete();
            $table->timestamp('enviado_at')->nullable();
            $table->enum('status_envio', ['pendiente', 'enviado', 'fallido'])->default('pendiente');
            $table->string('whatsapp_mensaje_id')->nullable();
        });
    }

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