#25866: Django migrations not picking up max_length change on FileField
--------------------------------------+------------------------------------
     Reporter:  gabn88                |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Migrations            |                  Version:  1.7
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by timgraham):

 * component:  Database layer (models, ORM) => Migrations
 * type:  Bug => Cleanup/optimization
 * easy:  1 => 0
 * stage:  Unreviewed => Accepted


Comment:

 I can reproduce the issue -- the choice of database shouldn't matter as
 it's an issue with the autodetector. I'm not sure how/if it can be fixed
 though. Any fields that use the default `max_length` won't have that data
 written to the migration file, so if the default is changed, Django has no
 way of knowing about this. We might have to document the limitation. I
 thought that adding an explicit `max_length` to any fields in existing
 migration files would be a workaround, but unless I made an error in my
 testing, this doesn't work although I didn't track down the reason why.

--
Ticket URL: <https://code.djangoproject.com/ticket/25866#comment:7>
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/064.67aaccc18934db758e21e9adb6193f2a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to