gpt4 book ai didi

django - 与模式迁移相比,南方数据迁移有什么作用?

转载 作者:行者123 更新时间:2023-12-04 02:08:17 24 4
gpt4 key购买 nike

我最近开始挖掘 South文档并发现它有两种不同类型的迁移:

  • 架构迁移
  • 数据迁移

  • 由于我的无知,我一直对所有事情都使用架构迁移。换句话说,即使我有真正的“数据迁移”,我也只是使用 South 的 schemamigration 来转换数据(没有明显的后果)。

    当我阅读文档时,我没有发现这种方法有什么问题。有谁知道这两种迁移之间的根本区别以及我坚持使用 schemamigrations 可能会遗漏什么?

    最佳答案

    实际上只有一种迁移,但有两个命令。 datamigration创建一个新的空白迁移供您填写,同时 schemamigration是一个可选的便捷命令,它将尝试检测模式更改并自动创建迁移。

    编辑:来自 http://south.aeracode.org/docs/commands.html#schemamigration

    While migrate is the real meat and bones of South, schemamigration is by comparison an entirely optional extra. It’s a utility to help write some of your migrations (specifically, the ones which change the schema) for you; if you like, you can ignore it and write everything youself, in which case we wish you good luck, and happy typing.

    关于django - 与模式迁移相比,南方数据迁移有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8358458/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com