Python: Django exception when executing migrate operation: django.db.utils.OperationalError: (1051, “Unknown table’xxx’”)

Problem scenario:    When executing Python migrate, an error is reported (1051, “unknown table ‘xxx’),   At this time, there is no ‘xxx’ table in the database

1. Comment out the tables in that you failed to update

2. Execute after comments are dropped

python makemigrations

python migrate --fake

3. After the above execution is successful, cancel the table annotation in

4. Cancel the comment and execute

python makemigrations

python migrate

Read More: