我有一个现有的模型,我想让它可以订购django-ordered-model
,我选择它是因为它与django.contrib.admin
.
现在该模型由 订购pk
,我想保留该订购。当我运行manage.py makemigrations
时它问我:
You are trying to add a non-nullable field 'orderable' to Item without a default;
we can't do that (the database needs something to populate existing rows).
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows)
2) Quit, and let me add a default in models.py
这两种选择似乎都是错误的。我应该怎么办?