Modify ↓
Ticket #98 (closed defect: fixed)
autodetection misses Meta.unique_together
| Reported by: | bendavis78@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.5 |
| Component: | commands | Version: | 0.6-pre |
| Keywords: | Cc: |
Description
myapp/models.py:
class Foo(Model):
bar = CharField(max_length=255)
baz = CharField(max_length=255)
class Meta:
unique_together = ('bar', 'baz')
dbshell:
mysql> SHOW CREATE TABLE myapp_foo\G
*************************** 1. row ***************************
Table: myapp_foo
Create Table: CREATE TABLE `myapp_foo` (
`id` int(11) NOT NULL auto_increment,
`bar` varchar(255) NOT NULL,
`baz` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
Would expect to see the following in the table definition:
UNIQUE KEY 'bar' ('bar', 'baz')
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Yup, this is because I haven't written it yet. It's on the list :)