<?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 = 'transfer_requests' AND column_name = 'form_number'"
    );
    if (!$exists) {
        $db->raw("ALTER TABLE `transfer_requests` ADD COLUMN `form_number` VARCHAR(50) NULL AFTER `new_membership_number`");
    }
};
