简体   繁体   English

Django 1.7-从南方迁移

[英]Django 1.7 - migrations from South

I have a project based on Django 1.6 with South. 我有一个基于Django 1.6和South的项目。 I wonder is it possible to upgrade my project to Django 1.7 with new built-in database migration system and save possibility to downgrade database to previous statements? 我想知道是否可以使用新的内置数据库迁移系统将项目升级到Django 1.7,并节省将数据库降级为以前的语句的可能性?

From a blog post I can't find anymore, the best way is to create two distinct directories: one new_migrations which will handle the migrations files (django 1.7), and another one old_migrations which will handle (if you need to) the downgrade part. 从我找不到的博客文章中,最好的方法是创建两个不同的目录:一个用于处理迁移文件的new_migrations(django 1.7),另一个用于处理(如果需要)降级部分的old_migrations 。

In order to do it, move your migrations folder to old_migrations, then recreate all your schema with the migrations built-in :) 为此,请将您的迁移文件夹移至old_migrations,然后使用内置的迁移方法重新创建所有架构:)

In case of downgrade, just move your old directory and use South as before. 如果降级,只需移动旧目录并像以前一样使用South。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM