Django 1.7 migrations don't respect db_table in M2M relation

69 views
Skip to first unread message

lza...@ucs.br

unread,
Dec 6, 2014, 8:10:42 AM12/6/14
to django-d...@googlegroups.com

Hi,

If is defined "db_table" in Meta class of a model, that you are using by through, the migrations create the table with original name, dosen't respect the db_table attribute defined on through model.

Instead of create table name "myapp_mychoicename" it create "myapp_test_company_related".

class Test(models.Model):
    company_related = models.ManyToManyField(Company,
                              verbose_name='xxxxxx',
                              related_name='xxxxxxx',
                              through='TestCompany')

class TestCompany(models.Model):
    test = models.ForeignKey(Test)
    company = models.ForeignKey(Company)

    class Meta:
        auto_created = Test
        db_table = 'myapp_mychoicename'


Enviado via UCSMail.

Tim Graham

unread,
Dec 6, 2014, 11:37:06 AM12/6/14
to django-d...@googlegroups.com
Please use Django's ticket tracker to report bugs in Django: https://code.djangoproject.com/newticket

Thanks!
Reply all
Reply to author
Forward
0 new messages