#25313: Document how to migrate from a built-in User model to a custom User
model
-------------------------------+------------------------------------
Reporter: Carl Meyer | 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 Tal500):
comment:24 was working well for me, together with a huge recommendation to
comment:25 ({{{elidable = True}}} and {{{atomic = False}}}).
I would like to add what you should do in case the "user" Django app has
no previous active migrations yet (which was my case), by still using the
proposal in comment:24.
Before stage 3, you should fake an initial migration, and apply it:
* Run {{{./manage.py makemigrations --empty user}}}. This will output an
empty migration file {{{0001_initial.py}}}.
* Run {{{./manage.py migrate user}}}.
Then, you should do the rest of the stages of comment:24, when stage 5
applies to the migration file {{{0001_initial.py}}} (after it has already
been done in the migration I mentioned).
BTW: After doing this process by my own both in local machine and on the
remote server, I recommend everyone to commit in the version control
system each step requires applying migration({{{./manage.py migrate
user}}}), so on the remove server you could checkout each step requires
applying migration and run {{{./manage.py migrate user}}} manually for
each such commit.
--
Ticket URL: <https://code.djangoproject.com/ticket/25313#comment:27>
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.74bba94ea767a1f392dc23bd938be5d5%40djangoproject.com.