在django中迁移数据的最佳方式是什么? [英] What is the best way to migrate data in django
本文介绍了在django中迁移数据的最佳方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PS:我想在一个地方看到很多解决方案。显然更多的解决方案已经列出了这里。
解决方案
我已经提出了类似的问题这里,并得到了很多答案。
有很多方法可以做,比如手动使用SQL进行转储和重新加载,使用fixture或使用Django的新兴模式演进包之一:
- Django Evolution
- 南部
- 分配
(有一个面板的 DjangoCon视频在Django中的n模式演进,讨论了这3个解决方案)
After making some changes in my models (eg. new field in a model and a new model) what is the best way of reflecting these changes to my populated database?
PS: I wanted to see many solutions in one place rated. Apparently more solutions are already listed here.
解决方案
I've asked a similar question here and got quite a few answers.
There are quite a lot of ways of doing it, like manually doing the dumping and reloading with SQL, using fixtures or using one of the "emerging" schema-evolution packages for Django:
- Django Evolution
- South
- dmigrations (there's a DjangoCon video of a panel on schema-evolution in Django where these 3 solutions are discussed)
这篇关于在django中迁移数据的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文