[1.7.x] Fixed #23699 -- Prevented flush from loading initial data for apps with migrations.

Backport of dd1ea70779 from master.
[1.7.x] Edited release note for refs #23621.