7 | | After I did a bit of digging, it seems like [https://github.com/django/django/blob/a4881f5e5d7ee38b7e83301331a0b4962845ef8a/django/db/backends/sqlite3/schema.py#L364 this particular line] was indeed the culprit. Instead of calling `related_objects` on `new_field.model._meta`, if we call `get_fields(forward=False, reverse=True, include_hidden=True)` on the same, the `ForeignKey` in the `through` Model changes its type according to the `ManyToManyField`. |
| 7 | After I did a bit of digging, it seems like [https://github.com/django/django/blob/a4881f5e5d7ee38b7e83301331a0b4962845ef8a/django/db/backends/sqlite3/schema.py#L364 this particular line] was indeed the culprit. Instead of calling `related_objects` on `new_field.model._meta`, if we call `_get_fields(forward=False, reverse=True, include_hidden=True)` on the same, the `ForeignKey` in the `through` Model changes its type according to the `ManyToManyField`. |