Django re-add the field and then migrate given the default value is still not effective migration

1、将对应app下的migrations文件夹下面的除了__init__.py文件外全部删除
2、delete from django_migrations where app='当前模型的app名称'
3、重新执行

   manage.py makemigrations Python
   Python manage.py the migrate
I have this problem before the first export the data in a database table, and then delete the data table, then perform the above operation, careful! ! !

Guess you like

Origin www.cnblogs.com/hqc-for-s/p/12049560.html