使用South And django 1.7迁移的可重用应用程序的升级路径 [英] Upgrade path for re-usable apps with South AND django 1.7 migrations

查看:120
本文介绍了使用South And django 1.7迁移的可重用应用程序的升级路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

或者:Django 1.7用户仍然可以使用南方?

Or: can Django 1.7 users still use South?

我是可重复使用的应用程序的维护者。我们的策略是始终支持最新的两个版本的Django。我们有一个广泛的南迁,我们希望支持新的Django 1.7迁移系统。

I'm the maintainer of a re-usable app. Our policy is to always support the latest two versions of Django. We have an extensive set of South migrations and, we want to support the new Django 1.7 migration system going forward.

我所困惑的是我如何允许开发人员使用我的应用程序与Django 1.6(和南)和Django 1.7(新迁移)。

What I'm confused with is how I can allow developers to use my app with both Django 1.6 (and South) and Django 1.7 (new migrations).

Django文档建议删除所有先前存在的南方迁移。但是这不是一个选择,因为我需要保持Django 1.6的用户。

The Django Documentation recommends just deleting all the pre-existing South migrations. But this is not an option, since I need to keep them around for my Django 1.6 users.

最接近我可以想到的升级路径是不用的新的迁移系统,直到我在我的应用程序中删除对Django< 1.7的支持(所以当Django 1.8出来时)。但是,使用migrate命令的命名冲突呢?南方和新系统都使用 python manage.py migrate 来运行迁移。那么Django 1.7用户不能再使用South了?

The closest to an upgrade path I could come up with, is not use the new migration system until I drop support for Django <1.7 in my app (so when Django 1.8 comes out). But what about the naming clash with the migrate command? Both South and the new system use python manage.py migrate to run migrations. So Django 1.7 users can't use South anymore?

推荐答案

提供解决方案。它将首先查看 south_migrations / 文件夹,并回到 migrations / 。所以在你需要支持旧的和更新的Djangos的第三方库的情况下:将南方文件移动到 south_migration / ,并在迁移/

South 1.0 provides the solution. It will look first in a south_migrations/ folder and fallback to migrations/. So in your case of third-party libraries needing to support older and newer Djangos: move South files to south_migration/ and create new 1.7 migrations in migrations/.

  • South 1.0 release notes
  • Django docs have also added this information

South不能与Django 1.7一起使用,但对于最终用户来说这不是问题。他们或者使用新的Django或更老的Djangos与南1.0。将不会有一个南方2.0,它将推出新的1.7式迁移。另外@ Ondrej的答案是正确的,它是在南1.0发布之前写的,所以当时(几个月前)的真相只包括解决方法。

South cannot be used with Django 1.7, but that's not a problem for end users. They either use new Django or older Djangos with South 1.0. There won't be a South 2.0, which was going to backport new 1.7-style migrations. Also @Ondrej's answer is correct just it was written before South 1.0 was released so the truth back then (mere months ago) consisted only of workarounds.

这篇关于使用South And django 1.7迁移的可重用应用程序的升级路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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