#32742: Running migrations when updating default_auto_field only updates primary
key.
----------------------------+--------------------------------------
     Reporter:  greemo      |                    Owner:  nobody
         Type:  Bug         |                   Status:  new
    Component:  Migrations  |                  Version:  3.2
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Unreviewed
    Has patch:  0           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+--------------------------------------
Changes (by Dan Dyer):

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


Comment:

 I've just encountered the same error migrating a project from Django
 2.2.24 to 3.2.7. I am not using django-polymorphic. In my case the foreign
 key that was causing the problem was a reference back to the same model
 (e.g. {{{ parent = models.ForeignKey('self')}}}).

 I am using MySQL.
 I had set {{{ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'}}} in
 {{{ settings.py }}}
 The migration failed with a warning about truncation.

 I just switched to using {{{AutoField}}} since my existing columns were
 that size already, but there does appear to be a problem to be fixed.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32742#comment:3>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.53849b1b1502fec52e094008853d51e2%40djangoproject.com.

Reply via email to