Accidentally deleted my django south migration directory

筅森魡賤 提交于 2019-12-11 03:15:20

问题


I accidentally deleted the South migrations directory for one of my Django apps. This directory was not under git.

So now there are migrations in the database that are not present on the disk.

Some pointers on how I can recover from this will be much appreciated.


回答1:


Without the option of any type of backup or finding the files somewhere, what you're going to have to do is make initial migrations and then fake them.

$ ./manage.py schemamigration app --initial
$ ./manage.py migrate app --fake

This will get you to where you are currently, however you won't have the option to migrate backwards.



来源:https://stackoverflow.com/questions/29355202/accidentally-deleted-my-django-south-migration-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!