MySQLdb._exceptions.ProgrammingError: (1146, "Table 'django_db.index_type' doesn't exist")

Django的内置模型User扩展,增加了几个字段,然后干掉了数据库,并删除了每个app下的migrations文件夹内除了__init__.py的所有文件。
然后执行:python manage.py makemigrations就报错:
MySQLdb._exceptions.ProgrammingError: (1146, "Table 'django_db.index_type' doesn't exist")
意思是找不到django_db.index_type这个表。
很明显,数据迁移就是为了创建数据库表,出现这个表明数据迁移之前程序已经在运行了,所以找不到表。
处理的办法是,注释掉项目的urls.py中的引用app的urls.py代码,如图:
MySQLdb._exceptions.ProgrammingError: (1146, "Table 'django_db.index_type' doesn't exist")