从所有应用程序应用迁移和模型 [英] Apply migrations and models from all the apps
本文介绍了从所有应用程序应用迁移和模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Django,并且具有类似
I'm using Django and I have an schema like
mainapp
|---mainapp
| |---migrations.py
| |---models/
|---app2
|---migrations/
|---models/
但是,当我执行以下操作时:
But, when I execute:
python manage.py migration
是生成 mainapp / models
的表,但没有 app2 / models
和 app2 / migrations
。
python manage.py migrate
it is generationg the tables of mainapp/models
, but no the app2/models
and app2/migrations
either.
如何执行这些迁移?
推荐答案
首先尝试
python manage.py makemigrations
对于特定应用
python manage.py makemigrations appname
这将迁移所有应用程序
然后
python manage.py migrate
希望有帮助
这篇关于从所有应用程序应用迁移和模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文