Django - 回归和南方 - 如何在更新模型时更新过去的修订?

发布于 2024-09-09 09:15:18 字数 161 浏览 1 评论 0原文

我想保留 MyModel 实例的过去修订版本,同时使用 South 更新和迁移 MyModel。

是否可以更新过去的修订?
是否有必要更新模型所有类型变更的修订版本?
什么样的更改(如果有)会迫使我无论如何删除修订历史记录?
有没有一种优雅的方法来自动化修订更新过程?

I would like to preserve past revisions of MyModel instances, while updating and migrating MyModel with south.

Is it possible to update the past revisions?
Is it necessary to update the revisions on all types of changes to the model?
What kind of changes, if any, will force me to erase the revision history no matter what?
Is there an elegant way to automate the revision updating process?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陌上青苔 2024-09-16 09:15:18

正如我在 filipe 发布的相关 github 问题上发布的那样,
使用像 couchdb 这样的“无模式”数据库可能是正确的选择,
当您想要优雅地对模式+数据进行版本控制时。

对模式转换进行自动模型转换
肯定是可能的,但我的经验是模式转换
单独的东西是脆弱的,需要大量的护理和测试。

那里有很多 nosql 数据库,并决定是否
couchdb 或 hbase 或 [插入您选择的 nosql 数据库] 都可以满足您的需求
在很大程度上取决于您的用例。

As i posted on the related github issue posted by filipe,
using a "schemaless" database like couchdb is probably the way to go,
when you want to version schemas+data elegantly.

Doing automatic model transformations on schema transformations
is surely posible, but my experience is that schema transformations
alone are fragile and require a lot of care and testing.

there are quite a lot of nosql databases outthere, and deciding if
couchdb or hbase or [insert your nosql database of choice] is ok for your needs
will depend a lot on your use case.

遥远的她 2024-09-16 09:15:18

虽然我没有明确的答案,但这篇文章可能会给你一些提示:
https://github.com/etianen/django-reversion/issues/50

Although I don't have a definite answer, this thread might give you some hints:
https://github.com/etianen/django-reversion/issues/50

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文