Django column “name” of relation “django_content_type” does not exist

后端 未结 8 1812
忘了有多久
忘了有多久 2020-12-23 14:31

I keep getting the following error when doing a migration (python manage.py migrate):

django.db.utils.ProgrammingError: column \"name\" of relation \"django_         


        
8条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 14:54

    Another variant that worked for me (from a blank database) was:

    ./manage.py makemigrations myappname
    ./manage.py migrate
    

    A variant which DID NOT work was:

    ./manage.py makemigrations myappname
    ./manage.py migrate myappname
    

    Or, rather, the sequence would apparently work the first time, but would not work the second time, complaining then that django_content_type did not exist.

    The working (first 2-line) variant above seems to be idempotent.

    (edited: to remove redundant second line from original 3-line working version)

提交回复
热议问题