[1.7.x] Added a warning about nonexistent FK constraints when unmigrated apps depend on migrated ones.

Thanks NotSqrt for the report; refs #23741.

Backport of f0ff452451 from master