Open
Description
Most of the migrations define their own models to avoid importing from the rest of the source code, but as seen in #8541, it is possible to make a mistake.
It would be useful to have some automated way to highlight when a migration is importing business domain code, as this is usually an overlook.
One option is a linting rule. This package seems to go in that direction https://pypi.org/project/import-linter/, but it would be good to be able to do this with the existing tooling.