Recover Dropped Table In Django : Table Doesn't Exist

Comment-out the model in and other locations where the model is induced, else System-checks will fail

python makemigrations
python migrate --fake


comment-in your model in
Run makemigrations and migrate again without using --fake

You are back on track.**

Note: This does not bring back the data lost when you dropped the table, it recreates the database table and allows further use of application


Tells Django to mark the migrations as having been applied or unapplied, but without actually running the SQL to change your database schema.

This is intended for advanced users to manipulate the current migration state directly if they’re manually applying changes; be warned that using --fake runs the risk of putting the migration state table into a state where manual recovery will be needed to make migrations run correctly.

发布了44 篇原创文章 · 获赞 2 · 访问量 1102


©️2019 CSDN 皮肤主题: 深蓝海洋 设计师: CSDN官方博客