#24506: Proxying User model creates an invalid migration
-------------------------------------+-------------------------------------
     Reporter:  tinloaf              |                    Owner:
                                     |  marcofucci
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     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
-------------------------------------+-------------------------------------

Comment (by Ernest0x):

 I added an example project as an attachment. Running 'migrate' reproduces
 the problem. The traceback above is shown when running the 'migrate'
 command for a second time as well as for subsequent runs. The first run
 also produces a traceback, which seems to be the same error but triggered
 in a different code path.

 The project's history/migrations:
 1) 'myapp' application has a MyModel model with a text field / The
 Django's default user model is being used (no AUTH_USER_MODEL is set).
 2) 'myapp' application's MyModel gets a foreign key to 'auth.Group'
 3) 'users' application is added to INSTALLED_APPS. It contains a custom
 User model.
 4) 'users' application gets a new Group model as a proxy to auth.Group and
 MyModel's foreign key is changed to point to 'users.Group'.
 AUTH_USER_MODEL is changed to 'users.User'
 5) 'myapp' application's MyModel gets a new text field. Migration file for
 this change is created without problems, but running 'migrate' fails with
 the trace above.

--
Ticket URL: <https://code.djangoproject.com/ticket/24506#comment:8>
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.54cd45064397e4a499256d5c72314fbb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to