Fixed #23410 -- Avoid unnecessary rollbacks in related apps when migrating backwards.