<?php
declare(strict_types=1);

return static function (\App\Core\Database $db): void {
    // Archive separated children under membership number 1701
    // These children were separated (فصل) but the old code didn't set is_archived=1
    $db->query(
        "UPDATE children c
         JOIN members m ON m.id = c.member_id
         SET c.is_archived = 1,
             c.archived_at = NOW(),
             c.updated_at = NOW()
         WHERE m.membership_number = '1701'
           AND c.status = 'separated'
           AND c.is_archived = 0"
    );
};
