修改了Article的model后,怎么更新到数据库
第一次建model时,漏了最后的括号:
title = models.TextField()
加上后出现错误:
OperationalError at /admin/blog/article/
no such column: blog_article.title
重新添加括号后,尝试 python manage.py makemigrations 但是出现如下问题:
You are trying to add a non-nullable field 'title' to article 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 with a null value for this column)
2) Quit, and let me add a default in models.py
此时选择1)也没有解决,应该怎么解决?