ou are trying to add a non-nullable field 'address' to person without a default; we can't do that (the database needs something to populate existing rows).

You are trying to add a non-nullable field 'address' to person 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 退出,在模型里添加默认值。(推荐)

Select an option:



问题是:

  在第一次初始化model之后,新添加了addres字段,这个字段没有默认值,所以他建议你给一个默认值;

posted @ 2020-08-05 19:46  忧伤还是快乐EL  阅读(458)  评论(0编辑  收藏  举报