django.db.utils.OperationalError: table "brand" already exists

Copyright: bloggers without consent, is prohibited reprint. Thank you! https://blog.csdn.net/cp_123321/article/details/86063875

The following error when you build a database migration file in django project: 

return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: table "brand" already exists

1 may be deleted db.sqlite3 database, then execute the following two commands

python manage.py makemigrations
python manage.py migrate

2. If db.sqlite3 can not delete, you can delete the following files, similar files are deleted, the command execution

python manage.py makemigrations
python manage.py migrate

 

 

Guess you like

Origin blog.csdn.net/cp_123321/article/details/86063875