#25313: Document how to migrate from a built-in User model to a custom User 
model
-------------------------------+------------------------------------
     Reporter:  carljm         |                    Owner:  nobody
         Type:  New feature    |                   Status:  new
    Component:  Documentation  |                  Version:  1.8
     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 carljm):

 Hmm. Clearly it must be partially possible, otherwise you could never do
 this at all if you use any third-party apps that link to `User` (since you
 won't be changing their migration files). The whole reason we special-case
 swappable models in migrations (instead of just treating them concretely)
 is to allow for migrations to not be dependent on the value of
 `AUTH_USER_MODEL`, so that reusable apps depending on `User` can still
 generate workable migrations.

 It's true that changing `AUTH_USER_MODEL` changes the _meaning_ of
 historical migrations in some sense, but it still seems to me that if our
 approach for reusable apps actually works, the same migration files ought
 to be salvageable (presuming that when you switch `AUTH_USER_MODEL` you
 point it to a new model that is initially exactly the same as the previous
 one, and then only modify it in later, separate migrations).

 But you've actually done this and I haven't, so I'm probably wrong...

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

Reply via email to