<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('evangelisations', function (Blueprint $table) {
            $table->id();
            $table->string('nom');
            $table->string('postnom');
            $table->string('prenom');
            $table->string('sexe');
            $table->integer('age');
            $table->string('adresse');
            $table->string('telephone');
            $table->string('chapelle');
            $table->string('facilitateur');
            $table->date('date');
            $table->longText('sujet');
            $table->boolean('isConverti')->default(false);
            $table->boolean('isRepentant')->default(false);
            $table->unsignedBigInteger('type_engagement_id');
            $table->timestamps();
            $table->foreign('type_engagement_id')->references('id')->on('type_engagements')->cascadeOnDelete();
        });
    }

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