﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36357	inspectdb creates a redundant unique_together for composite primary keys	Baptiste Mispelon	Baptiste Mispelon	"With the following table:
{{{#!sql
CREATE TABLE example (
    a integer,
    b integer,
    c integer,
    PRIMARY KEY (a, c)
);
}}}

Running `inspectdb` produces the following model definition:
{{{#!py
class Example(models.Model):
    pk = models.CompositePrimaryKey('a', 'c')
    a = models.IntegerField()
    b = models.IntegerField(blank=True, null=True)
    c = models.IntegerField()

    class Meta:
        managed = False
        db_table = 'example'
        unique_together = (('a', 'c'),)
}}}

I'm pretty sure the last `unique_together = (('a', 'c'),)` is redundant since the `pk = models.CompositePrimaryKey('a', 'c')` already implies uniqueness, no?"	Bug	closed	Database layer (models, ORM)	5.2	Release blocker	fixed	CompositePrimaryKey		Ready for checkin	1	0	0	0	0	0
