<?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('emploi_details', function (Blueprint $table) {
            $table->id();
            $table->foreignId('annonce_id')->constrained()->cascadeOnDelete();
            $table->string('poste');
            $table->string('entreprise')->nullable();
            $table->string('type_contrat')->nullable();     // CDI, CDD, stage, freelance...
            $table->decimal('salaire_min', 12, 2)->nullable();
            $table->decimal('salaire_max', 12, 2)->nullable();
            $table->text('comment_postuler')->nullable();
            $table->date('date_limite')->nullable();
            $table->timestamps();
        });
    }

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