Re: [Django] #2495: db.models.TextField cannot be marked unique when using mysql backend

10 views
Skip to first unread message

Django

unread,
May 29, 2011, 2:14:27 PM5/29/11
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner: Honza_Kral
Type: Bug | Status: new
Milestone: 1.3 | Component: Database layer
Version: SVN | (models, ORM)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords: mysql TextField
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 1 | Needs tests: 0
| Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by eigrad):

* cc: eigrad (added)
* easy: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/2495#comment:32>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 22, 2013, 6:11:40 PM7/22/13
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner:
Type: Bug | Honza_Kral
Component: Database layer | Status: new
(models, ORM) | Version: master
Severity: Normal | Resolution:
Keywords: mysql TextField | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by eigenhombre):

Just got bit by this, so here's my +1...

--
Ticket URL: <https://code.djangoproject.com/ticket/2495#comment:12>

Django

unread,
Dec 19, 2013, 2:41:53 PM12/19/13
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner:
Type: Bug | Honza_Kral
Component: Database layer | Status: new
(models, ORM) | Version: master
Severity: Normal | Resolution:
Keywords: mysql TextField | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by anubhav9042):

I think that this is a problem of MYSQL and not Django. MySQL does not
stores the key length for longtext types. So its not possible to assign a
fey specification before that. And that seems to be a bug of MySQL.

--
Ticket URL: <https://code.djangoproject.com/ticket/2495#comment:13>

Django

unread,
Aug 31, 2014, 3:56:46 PM8/31/14
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner:
Type: Bug | Honza_Kral
Component: Database layer | Status: new
(models, ORM) | Version: master
Severity: Normal | Resolution:
Keywords: mysql TextField | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

After eight years, and considering that the fix is far from easy, could we
file this under "use a better database" and close the ticket?

--
Ticket URL: <https://code.djangoproject.com/ticket/2495#comment:14>

Django

unread,
Aug 24, 2015, 1:08:11 PM8/24/15
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner:
| Honza_Kral
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |

Severity: Normal | Resolution:
Keywords: mysql TextField | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* Attachment "2495-doc.diff" added.


--
Ticket URL: <https://code.djangoproject.com/ticket/2495>

Django

unread,
Aug 24, 2015, 1:08:38 PM8/24/15
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner:
| Honza_Kral
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql TextField | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 1 => 0


Comment:

Attached a patch to document the limitation.

--
Ticket URL: <https://code.djangoproject.com/ticket/2495#comment:15>

Django

unread,
Aug 27, 2015, 9:30:30 AM8/27/15
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner:
| Honza_Kral
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql TextField | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"e8cbc2b322d873a6fe39faca18d340ce93035087" e8cbc2b]:
{{{
#!CommitTicketReference repository=""
revision="e8cbc2b322d873a6fe39faca18d340ce93035087"
Refs #2495 -- Documented that MySQL cannot have TextField(unique=True).
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/2495#comment:16>

Django

unread,
Aug 27, 2015, 9:30:45 AM8/27/15
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner:
| Honza_Kral
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql TextField | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"4f83bfa9e5ef10c6c9711ad529630d09a06ef413" 4f83bfa]:
{{{
#!CommitTicketReference repository=""
revision="4f83bfa9e5ef10c6c9711ad529630d09a06ef413"
[1.8.x] Refs #2495 -- Documented that MySQL cannot have
TextField(unique=True).

Backport of e8cbc2b322d873a6fe39faca18d340ce93035087 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/2495#comment:17>

Django

unread,
Aug 27, 2015, 9:31:01 AM8/27/15
to django-...@googlegroups.com
#2495: db.models.TextField cannot be marked unique when using mysql backend
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner:
| Honza_Kral
Type: Bug | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: wontfix

Keywords: mysql TextField | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => wontfix


--
Ticket URL: <https://code.djangoproject.com/ticket/2495#comment:18>

Reply all
Reply to author
Forward
0 new messages