diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 78815c2..2fb6af6 100644
a
|
b
|
class ManyToManyField(RelatedField):
|
2088 | 2088 | def deconstruct(self): |
2089 | 2089 | name, path, args, kwargs = super(ManyToManyField, self).deconstruct() |
2090 | 2090 | # Handle the simpler arguments |
| 2091 | if self.db_table is not None: |
| 2092 | kwargs['db_table'] = self.db_table |
2091 | 2093 | if self.rel.db_constraint is not True: |
2092 | 2094 | kwargs['db_constraint'] = self.rel.db_constraint |
2093 | 2095 | if "help_text" in kwargs: |
diff --git a/tests/field_deconstruction/tests.py b/tests/field_deconstruction/tests.py
index 04d4c6a..9a330b2 100644
a
|
b
|
class FieldDeconstructionTests(TestCase):
|
271 | 271 | self.assertEqual(path, "django.db.models.ManyToManyField") |
272 | 272 | self.assertEqual(args, []) |
273 | 273 | self.assertEqual(kwargs, {"to": "auth.Permission", "through": "auth.Group"}) |
| 274 | # Test custom db_table |
| 275 | field = models.ManyToManyField("auth.Permission", db_table="custom_table") |
| 276 | name, path, args, kwargs = field.deconstruct() |
| 277 | self.assertEqual(path, "django.db.models.ManyToManyField") |
| 278 | self.assertEqual(args, []) |
| 279 | self.assertEqual(kwargs, {"to": "auth.Permission", "db_table": "custom_table"}) |
274 | 280 | |
275 | 281 | @override_settings(AUTH_USER_MODEL="auth.Permission") |
276 | 282 | def test_many_to_many_field_swapped(self): |