<?php

use App\Models\MaritalStatus;
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::table('marital_statuses', function (Blueprint $table) {
            $table->boolean('show_wife_children_option')->default(false);
        });

        MaritalStatus::whereIn('name',['Married','Widowed','Divorced'])->update(['show_wife_children_option'=>true]);
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('marital_statuses', function (Blueprint $table) {
            $table->dropColumn('show_wife_children_option');
        });
    }
};
