1146 error django perfect solution when migrating databases appear

Django perfect solution to this error occur when migrating databases ------> django.db.utils.ProgrammingError: (1146, "Table 'django_demo.tb_foods' does not exist")

Tonight at the time of the migration of the database, the database before migration, found after the migration to build their own database in question, and then carried out the operation to delete the library.

When migrating data after their own again and found there was an error 1146,

Focus here
at the moment you do not watch the data you want to create,
but still error 1146
只需要把你子项目中这里多余的文件删除掉即可
Here Insert Picture Description
deleted after to see if the existence of the database table you create yourself delete just finedrop table 表名

Eventually migrating the database
to perform these two is like a path in your project
python manage.py makemigrations
python manage.py migrate

个人见解, 不足之点请大佬多多指教~~~
Published 56 original articles · won praise 17 · views 2098

Guess you like

Origin blog.csdn.net/LanlanDeming/article/details/103941075