<?php
declare(strict_types=1);

return function (\App\Core\Database $db): void {
    // form_number already exists — only add deceased_member_name if missing
    $exists = $db->selectOne(
        "SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 'members' AND column_name = 'deceased_member_name'"
    );
    if (!$exists) {
        $db->raw("ALTER TABLE members ADD COLUMN deceased_member_name VARCHAR(255) NULL AFTER form_number");
    }
};
