Django-polymorphic models having issues making migrations on 1.7

不打扰是莪最后的温柔 提交于 2019-12-06 03:42:49

This has got nothing to do with polymorphic package I guess.

What I have done to fix it is to comment out my apps, leaving the builtin django apps, run ./manage.py migrate to migrate the system apps, then uncomment my apps, and run ./manage.py makemigrations

You can also try this:

1) Add a migrations directory to the problematic app (orders in this case).

mkdir /path/to/your/app/migrations

2) Add an __init__.py to that same migrations directory.

touch /path/to/your/app/migrations/__init__.py

3) Run python manage.py makemigrations <yourapp>

4) Migrate any other apps, individually or as a whole, if you are fortunate.

And that should solve it. It's less error prone and hacky than depending on commenting out any installed apps, which isn't really consistent or reproducible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!