#56: Primary key columns should be UNSIGNED
-------------------------------------+-------------------------------------
Reporter: Manuzhai <mail@…> | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Collin Anderson):
* needs_better_patch: 1 => 0
Comment:
https://github.com/django/django/pull/8183
I just ran into a situation where I have a legacy mysql table that has a
`bigint(20) unsigned auto_increment` primary key that I want to point a
new `ForeignKey` to. Django is creating the foreign key as `bigint(20)`
rather than `bigint(20) unsigned`, and mysql won't allow a foreign key
constraint between the two.
So basically, I need the legacy table primary key to be a
`PositiveBigAutoField`, and the `ForeignKey` needs to be a
`PositiveBigIntegerField`.
--
Ticket URL: <https://code.djangoproject.com/ticket/56#comment:44>
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/085.9947066db237d24ff7309bfba35c7273%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.