本文介绍了不小心删除了我的django南迁移目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不小心删除了其中一个Django应用程式的South migrations目录。这个目录不在git下。
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.
推荐答案
没有任何类型的备份或找到文件的地方,什么地方你将要做的是进行初始迁移,然后伪造它们。
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.
更多推荐
不小心删除了我的django南迁移目录
发布评论