Thanks for filling up this thread @hannylicious and your work on the unmanaged models tracking work.
Taking a minute to reflect about this more this morning I think that the main reason why unmanaged started being tracked in the first place is to support the case where a managed model references an unmanaged model through a foreign key. In this case where relationships cross the management boundary we must track referenced unmanaged models in order to generate the proper REFERENCES
clause and allow joining against them.
I guess that this case could be solved by raising an exception when --ignore-unmanaged
(or whatever opt-in mechanism is deemed appropriate) is requested but there’s a new managed model referencing an unmanaged one.
With all the edge case required to get this right and the apparent low usage of unmanaged models in migrations (it took us almost a decade to notice the problem you recently reported) I think that your usage could be qualified as uncommon and thus not meet the bar for inclusion in core particularly with the upcoming support for user defined auto-detector classes that would allow you to systematically exclude unmanaged models from to_state
and thus achieve what you’re after.