Django Models (1054, “Unknown column in 'field list'”)

后端 未结 13 1705
庸人自扰
庸人自扰 2020-12-08 13:18

No idea why this error is popping up. Here are the models I created -

from django.db import models
from django.contrib.auth.models import User

class Shows(m         


        
13条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 13:39

    I faced the same error like you posted above with MySQL database back-end, after long time of resolving this error, I ended up with below solution.

    1. Manually added column to database through workbench with name exactly the same as it is shown in your error message.

    2. After that run below command

    python manage.py makemigrations
    

    Now migrations will be successfully created

    1. After that run below command
    python manage.py migrate --fake
    

    Now every thing works fine without any data lose issue

提交回复
热议问题