在django中迁移数据的最佳方式是什么? [英] What is the best way to migrate data in django

查看:135
本文介绍了在django中迁移数据的最佳方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的模型中进行了一些更改(例如模型和新模型中的新字段)后,将这些更改反映到我填充的数据库中的最佳方法是什么?






PS:我想在一个地方看到很多解决方案。显然更多的解决方案已经列出了这里

解决方案

我已经提出了类似的问题这里,并得到了很多答案。



有很多方法可以做,比如手动使用SQL进行转储和重新加载,使用fixture或使用Django的新兴模式演进包之一:




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中迁移数据的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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