简体   繁体   English

manage.py makemigrations有效,但manage.py migration无效

[英]manage.py makemigrations works but manage.py migrate did not

enter image description here 在此处输入图片说明

how to solve the error.I first created the model with only one class and the makemigrations and migrate work perfect. 如何解决错误。我首先创建了一个只有一个类的模型,makemigrations和migration完美地完成了工作。 but now i add another class in model but now migrate did not work the output is in pic. 但是现在我在模型中添加了另一个类,但是现在迁移无法正常工作,输出结果如图所示。 django version is 1.11 and i also register it in admin.py django版本是1.11,我也在admin.py中注册了它

python manage.py makemigrations ----> for all app 适用于所有应用的python manage.py makemigrations ---->

python manage.py makemigrations app_name ----> for a specific app 适用于特定应用的python manage.py makemigrations app_name ---->

python manage.py migrate ----> for all the apps, python manage.py migrate ---->对于所有应用程序,

NB = migrate doesnt take any app name , you need to run only python manage.py migrate NB = migrate不带任何app name ,您只需要运行python manage.py migrate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM