莫名其妙的错误。

删除了migreation文件,并且更换了数据库。

1.直接makemigrations + migrate    error: no change ??  WTF

2.makemigrations app   + migrate app   循环完成      no error, but can't use this project.    WTF  +1

3.makemigrations app1 + makemigrations app2 ...   migrate         oh, success.      what's happend ?

 

 

其原因是已经找到(删除数据库的所有表后,django迁移并不会生成django自带的表),可以:更换数据库后,可先makemigrations + migrate,

再次makemigrations app + migrate app   或者

只删除创建的表和删除django_migrations表格中关于 删除创建的表的记录就不会出错

 

相关文章:

  • 2022-12-23
  • 2021-05-14
  • 2022-02-08
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
猜你喜欢
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
  • 2022-01-08
  • 2021-07-21
相关资源
相似解决方案