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

后端 未结 8 1817
忘了有多久
忘了有多久 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:56

    I was getting this error after we decided to remove migrations from version control (git) and create a new database from scratch.

    Something that worked for me (although to be honest I'm not sure why) was to run 'makemigrations' for each app. so, 'python manage.py makemigrations app1', 'python manage.py makemigrations app2', and so on for each Django app.

    Finally, I just ran 'python manage.py migrate', crossed my fingers, and it worked.

    Any insight into how/why this worked would be helpful.

提交回复
热议问题