<?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('mariage_alls', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('epoux_id');
            $table->unsignedBigInteger('epouse_id');
            $table->unsignedBigInteger('type_mariage_id');
            $table->string('lieu');
            $table->date('date');
            $table->string('observation');
            $table->boolean('status')->default(true);
            $table->timestamps();
            $table->foreign('epoux_id')->references('id')->on('personnes')->cascadeOnDelete();
            $table->foreign('epouse_id')->references('id')->on('personnes')->cascadeOnDelete();
            $table->foreign('type_mariage_id')->references('id')->on('type_mariages')->cascadeOnDelete();
        });
    }

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