执行python manage.py makemigrations没有问题,但是执行python manage.py migrate时却报如下错误
Traceback (most recent call last):
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\utils.py”, line 89, in _execute
return self.cursor.execute(sql, params)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\sqlite3\base.py”, line 329, in execute
return super().execute(query, params)
sqlite3.IntegrityError: NOT NULL constraint failed: django_migrations.id
解决方法:更新django,我从4.2.9更新到4.2.11就不报错了