Django makemigrations 坑请注意(relation does not exist)

Django makemigrations 坑请注意(relation does not exist)

情景描述

今天在迁移项目时,发现运行python manage makemigrations 后出现问题了。很多表总是无法生成,后来Google到解决方案,原来django 的makemigrations 会造成表格不全

django.db.utils.ProgrammingError: relation “UserCoreApp_userstype” does not exist
LINE 1: SELECT COUNT(*) AS “__count” FROM “UserCoreApp_userstype”

解决方案

单独运行makemigrations

python manage.py migrate UserCoreApp
    原文作者:iCloudEnd
    原文地址: https://www.jianshu.com/p/344cd3014834
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞