Django makemigrations 坑請注意(relation does not exist)
情景描述
今天在遷移項目時,發(fā)現(xiàn)運(yùn)行python manage makemigrations 后出現(xiàn)問題了得糜。很多表總是無法生成敬扛,后來Google到解決方案,原來django 的makemigrations 會造成表格不全
django.db.utils.ProgrammingError: relation "UserCoreApp_userstype" does not exist
LINE 1: SELECT COUNT(*) AS "__count" FROM "UserCoreApp_userstype"
解決方案
單獨運(yùn)行makemigrations
python manage.py migrate UserCoreApp