[ticket/13303] Speed up migration dependency calculation.

PHPBB3-13303
Merge pull request #3117 from prototech/ticket/13303

[ticket/13303] Speed up migration dependency calculation.

* prototech/ticket/13303:
  [ticket/13303] Speed up migration dependency calculation.