<?php
declare(strict_types=1);

return function (\App\Core\Database $db): void {
    $exists = $db->selectOne(
        "SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 'death_cases' AND column_name = 'form_number'"
    );
    if (!$exists) {
        $db->raw("ALTER TABLE death_cases ADD COLUMN form_number VARCHAR(50) NULL AFTER primary_spouse_form_filled");
    }
};
