<?php

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

class CreatePostulanteFotosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('postulante_fotos', function (Blueprint $table) {
            $table->id();
            
            // Relación con la tabla postulantes
            // Asegurate de que tu tabla de postulantes se llame 'postulantes'
            $table->foreignId('postulante_id')
                ->constrained('postulantes') 
                ->onDelete('cascade'); 

            $table->string('ruta_foto');
            $table->text('detalle')->nullable();
            $table->timestamps();
        });
    }

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