Revert "[1.7.x] Fixed #22331 -- Fixed migrations ProjectState to ignore unmanaged models."

This reverts commit bf69375c4d2eaec4f00c646b9e7e84a9397d1a20.