#26068: Django 1.8: KEY constraint for parent model missing in m2m [regression]
-------------------------------------+-------------------------------------
Reporter: direx | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.8
(models, ORM) | Resolution:
Severity: Normal | worksforme
Keywords: mysql,m2m | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):
* status: new => closed
* resolution: => worksforme
* needs_tests: => 0
* needs_better_patch: => 0
* needs_docs: => 0
* type: Uncategorized => Bug
Comment:
I couldn't reproduce this. Here's what I see after `manage.py
makemigrations && manage.py migrate`:
{{{
CREATE TABLE `t26068_user_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user_id` (`user_id`,`group_id`),
KEY `t26068_user_groups_e8701ad4` (`user_id`),
KEY `t26068_user_groups_0e939a4f` (`group_id`),
CONSTRAINT
`t26068_user_groups_group_id_33e3cfed1d09dff9_fk_t26068_group_id` FOREIGN
KEY (`group_id`) REFERENCES `t26068_group` (`id`),
CONSTRAINT
`t26068_user_groups_user_id_308a5058396822ca_fk_t26068_user_id` FOREIGN
KEY (`user_id`) REFERENCES `t26068_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
}}}
I tested without migrations as well. I guess we'll need a sample project
or more details to debug it.
--
Ticket URL: <https://code.djangoproject.com/ticket/26068#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.aec78f6fb29f3c67b8862f0b40bcdf93%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.