Fixed #22881 -- Better soft_applied migration detection