本文介绍了--fake-initial与--fake在Django迁移中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Django迁移中,-fake-initial -fake 有什么区别?使用假迁移有什么危险?有人知道吗非常感谢大家。

What is the difference between --fake-initial and --fake in Django migrations? What are the dangers of using fake migrations? Anybody knows? Thank you very much to all.

我正在使用django 1.10

I am using django 1.10

推荐答案

文件对此非常清楚

您在问风险,好吧,这是

You were asking about the risks, well here it is



-伪造



--fake

如果高级用户手动进行更改,则可以直接操作当前的
迁移状态;

This is intended for advanced users to manipulate the current migration state directly if they’re manually applying changes;

再次明确指出了风险

此答案不仅对Django 1.8+版本有效,对其他版本也有效。

This answer is valid not just for django versions 1.8+ but for other versions as well.

编辑,2018年11月:我有时在这里和其他地方看到答案,建议您删除数据仓库。那几乎从来都不是正确的事。如果删除数据库,则会丢失所有数据。

edit Nov, 2018: I sometimes I see answers here and elsewhere that suggest that you should drop your databae. That's almost never the right thing to do. If you drop your database you lose all your data.

这篇关于--fake-initial与--fake在Django迁移中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 10:38