Table Solution mistakenly deleted the model in Django

Table Solution mistakenly deleted the model in Django

The actual operation 1.model inside tables are migrations folder, which records the operation, when you delete a table in the database and model should pay attention to initialize the database will complain, delete records in the file to perform migrations without result, because this table is not already in the database, so an error.

2. Solution: Initialize command does not change after the implementation of the code plus --fake

python manage.py migrate --fake # ignore delete operation

Guess you like

Origin www.cnblogs.com/wylshkjj/p/12114345.html