#31144: MySQL unique constraints incorrectly limited to 255 char when it should 
be
1000.
-------------------------------------+-------------------------------------
     Reporter:  Steven Mapes         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  MySQL, MariaDB,      |             Triage Stage:
  Indexes, Unique Keys               |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Steven Mapes):

 Replying to [comment:9 Sameeran Bandishti]:
 > Hi! I would like to take up this issue if no one is already working on
 it. I'm new to this codebase, so I might need a little help if that's okay
 :)

 That would be great from my point of view. I would just make the change
 and publish a PR for it myself but I'm unsure on how best to write the
 unit tests without them being actual integration tests other than using
 mocks to raise the error or not but then it seems rather pointless of a
 test.

 For me the change is either

 1. Remove lines 37 through 45 of
 ```db.backends.mysql.validation.check_field_type``` as they are simply not
 needed as the DB itself will trigger an error.
 2. Change ```checks.Error``` on line 40 to ```checks.Warning``` and update
 the error message to be one that is more useful. E.G to instruct the
 developer to check the documentation and for the limits based on the
 character set they are using for the database/table/column.

 The docs should also be updated to remove any reference to MySQL having a
 255 char limit on VARCHAR as its not true

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31144#comment:10>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.dac892c33c642222623d5a40f08c0231%40djangoproject.com.

Reply via email to