[1.7.x] Fixed #22265 -- Clarfied consistent behavior of migrations.

Thanks aruseni for the report.

Backport of bff77e2aa8 from master