报错:

You are trying to add a non-nullable field 'BookName' to BookInfo 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

 

原因:

在模型类中添加了一个非空字段,而该模型类对应的表中,已经存在数据,而这些现存的数据并没有新增字段的值

 

 

 

 

相关文章:

  • 2021-06-20
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
猜你喜欢
  • 2021-08-10
  • 2021-08-21
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
相关资源
相似解决方案