auth_user error with Django 1.8 and syncdb / migrate

前端 未结 8 1095
独厮守ぢ
独厮守ぢ 2021-01-31 14:03

When upgrading to Django 1.8 (with zc.buildout) and running syncdb or migrate, I get this message:

django.db.utils.ProgrammingError: relation \"auth_user\" does no

8条回答
  •  没有蜡笔的小新
    2021-01-31 15:08

    This problem is contained by running "makemigrations" for all apps, that have not yet been migrated, i.e. apps that do not yet have an "initial_0001.py" file in their migrations directory.

    This is done (in our case we use a makefile) by running for each of these apps:

    manage.py makemigrations app_name
    

    Once that is done, you can execute:

    manage.py migrate
    

    as usual.

    The underlying cause for this is that for some reason

    manage.py makemigrations
    

    does not always create these initial migrations if they are not already there. And that leads to the mentioned error.

    On the contrary,

    manage.py makemigrations app_name
    

    does always create them (if not already there). Unfortunately I cannot fathom the reasons for this asymmetry.

提交回复
热议问题