Django migration data error report table exists

Django migration data error report table exists

The error is reported as follows: (django.db.utils.InternalError:(1050,"Table 'tb_content' already exists"))

Solution:
First delete the generated files under migrations in the project directory, such as:
Insert image description here
Then enter:
python manage.py makemigrations --fake
1
python manage.py migrate --fake
1
The specific effect is as follows:
Insert image description here
Finally, perform the migration operation:
#Generate Migration file
python manage.py makemigrations
#Execute migration command
python manage.py migrate

Guess you like

Origin blog.csdn.net/weixin_40012925/article/details/126838812