不小心删除了我的django南迁移目录 [英] Accidentally deleted my django south migration directory

查看:182
本文介绍了不小心删除了我的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南迁移目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆