#25238: Django1.8 migrations, custom user model, in non-SQLite databases
-------------------------------------+-------------------------------------
     Reporter:  mallyvai             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     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
-------------------------------------+-------------------------------------
Description changed by mallyvai:

Old description:

> I've outlined the details here:
> http://stackoverflow.com/questions/31844053/bizarre-issues-with-
> django-1-8-migrations-custom-user-model-and-postgres-mysql
>
> Basically - developing with SQLite3 worked perfectly fine with my custom
> user model {{{class Client(AbstractBaseUser, PermissionsMixin}}}
>
>   When time came to get to production and use postgres or mysql, things
> started failing. The root of it is that the migrations aren't being run
> in the right order, and there are foreign key relations that aren't
> maintained.
>
> What's odd is that running {{{./manage.py migrate}}} twice in a row seems
> to work. Unfortunately this doesn't seem to help with tests. In no
> particular order, I would love some advice on:
>
> 1) How to unblock myself such that stuff 'just works' (my nuclear option
> is removing the custom user model and custom user manager, and migrating
> the old data over, which will take some time)
>
> 2) Understanding why everything seemed to work fine with SQLite, and why
> it fails with postgres/mysql
>
> The solution of running `./manage.py makemigrations offerdrive'` listed
> here doesn't help unfortunately...:
> https://code.djangoproject.com/ticket/24524

New description:

 I've outlined the details here:
 http://stackoverflow.com/questions/31844053/bizarre-issues-with-django-1-8
 -migrations-custom-user-model-and-postgres-mysql

 Basically - developing with SQLite3 worked perfectly fine with my custom
 user model {{{class Client(AbstractBaseUser, PermissionsMixin}}} and
 custom User Manager {{{class UserManager(BaseUserManager):}}}

   When time came to get to production and use postgres or mysql, things
 started failing. The root of it is that the migrations aren't being run in
 the right order, and there are foreign key relations that aren't
 maintained.

 What's odd is that running {{{./manage.py migrate}}} twice in a row seems
 to work. Unfortunately this doesn't seem to help with tests. In no
 particular order, I would love some advice on:

 1) How to unblock myself such that stuff 'just works' (my nuclear option
 is removing the custom user model and custom user manager, and migrating
 the old data over, which will take some time)

 2) Understanding why everything seemed to work fine with SQLite, and why
 it fails with postgres/mysql

 The solution of running `./manage.py makemigrations offerdrive'` listed
 here doesn't help unfortunately...:
 https://code.djangoproject.com/ticket/24524

--

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

Reply via email to