Combined/composite primary key or composite unique field?
1,939 views
Skip to first unread message
Hugo Heyman
unread,
Jul 20, 2012, 8:14:44 AM7/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to peewe...@googlegroups.com
Hi
I'm wondering if it is possible to make a composite primary key, or maybe composite unique fields? I could not find anything on this topic in this mailing list or in the docs.
If not is there some other way around to achieve the same result?
Thanks!
/Hugo
Charles
unread,
Jul 20, 2012, 10:16:47 AM7/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to peewe...@googlegroups.com
Unfortunately, there aren't at this time but its something I'm interested in adding.
Charlie
Hugo Heyman
unread,
Jul 20, 2012, 10:35:43 AM7/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to peewe...@googlegroups.com
Ok, thanks for a fast reply.
I looked at the django ORM, and apparently it does not support composite primary key either, however they have unique-together for similar use. Maybe that's something to consider adding.
/Hugo
Charles
unread,
Aug 13, 2012, 3:37:50 PM8/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to peewe...@googlegroups.com
Just thought I'd let you know it is now possible to add multi-column indexes (including w/unique constraint):