diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
index 638ae08..dfe7d47 100644
a
|
b
|
class BaseDatabaseSchemaEditor(object):
|
262 | 262 | }) |
263 | 263 | # Make M2M tables |
264 | 264 | for field in model._meta.local_many_to_many: |
265 | | self.create_model(field.rel.through) |
| 265 | if field.rel.through._meta.auto_created: |
| 266 | self.create_model(field.rel.through) |
266 | 267 | |
267 | 268 | def delete_model(self, model): |
268 | 269 | """ |
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 3c022d6..8dd75ba 100644
a
|
b
|
class ManyToManyField(RelatedField):
|
1996 | 1996 | kwargs['to'] = self.rel.to |
1997 | 1997 | else: |
1998 | 1998 | kwargs['to'] = "%s.%s" % (self.rel.to._meta.app_label, self.rel.to._meta.object_name) |
| 1999 | if getattr(self.rel, 'through', None) is not None: |
| 2000 | kwargs['through'] = self.rel.through |
1999 | 2001 | # If swappable is True, then see if we're actually pointing to the target |
2000 | 2002 | # of a swap. |
2001 | 2003 | swappable_setting = self.swappable_setting |