问题描述
我想为我的应用程序中的模型创建一个表,显然 python manage.py sqlall myapp不起作用
I want to create a table for my models in my app, apparently the "python manage.py sqlall myapp" doesn't work
我尝试使用 python manage.py sqlmigrate myapp,我仍然收到错误
I tried using the "python manage.py sqlmigrate myapp", i still get errors
要使用的正确命令是什么?
what is the proper command to use?
我正在使用django 1.11.7
谢谢
i am using django 1.11.7thanks
推荐答案
sqlmigrate
命令只是打印出要迁移的SQL,它不会运行它。您应该运行 migrate
进行更改。
The sqlmigrate
command just prints out the SQL for the migration, it does not run it. You should run migrate
to make the changes.
请参见以获取有关迁移命令的更多信息。
See the Migrations docs for more information about the migration commands.
sqlall
命令为,同时删除了 syncdb
。
The sqlall
command was removed in Django 1.9 at the same time as syncdb
was removed.
这篇关于Manage.py sqlall不在我的应用程序中为模型创建表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!