【发布时间】:2016-11-21 01:56:13
【问题描述】:
我正在尝试使用模式迁移,因为我有我的模型,其中我之前有两个模型,并且我已经创建了另外三个模型。 我尝试了几个命令,例如
python manage.py schemamigration appname --add modelname
python manage.py schemamigration appname
python manage.py schemamigration
python manage.py schemamigration appname --fake
但没有运气
有时它会给我错误
You have not passed any of --initial, --auto, --empty, --add-model, --add-field or --add-index.
有时这个
sage: manage.py schemamigration [options]
Creates a new template schema migration for the given app
manage.py: error: ambiguous option: --add (--add-field, --add-index, --add-model?)
我是 django 新手,所以需要一些帮助。
【问题讨论】:
-
如果您使用的是较新版本的 Django,则架构迁移不再需要 south。尝试使用 Django 的迁移内容。该过程是 1) 进行迁移,然后 2) 实际应用它们。命令是:1)python manage.py makemigrations 2)python manage.py migrate
标签: django django-models django-south