When migrating an existing db how do you create a proper join table
for a ManyToMany field. I think I've got it mostly worked out except
for the bit that looks like this in Django generated SQL:

CREATE TABLE `blog_posts_authors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `post_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `post_id` (`post_id`,`user_id`),
  KEY `user_id_refs_id_ea0040bf` (`user_id`) /* <========= GENERATED ?
*/
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

Django creates some kind of random key, If I generate a random key in
my own join table will Django automatically use this?

Thanks
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to