简体   繁体   English

在Django South的多次迁移

[英]Multiple migrations in django south

I couldn't find a clear cut answer to this via google or the south docs, so i'm posting it here. 我无法通过Google或South Docs找到明确的答案,因此我将其发布在这里。

I've been using south for a while to manage my django models, however, until now i've always done one migration, pushed to the production server and migrated on there as well. 我一直在南方使用django模型进行管理,但是直到现在,我一直都在进行一次迁移,将其推送到生产服务器,然后再迁移到那里。 I was wondering, is it possible to do multiple migrations on the production server at the same time? 我想知道,是否可以在生产服务器上同时进行多个迁移?

For example, if i create multiple migrations on my dev server (that were migrated only on the dev server), if i push the migrations via git and run migrate AppName, will it run all the migrations its missing? 例如,如果我在开发服务器上创建了多个迁移(这些迁移仅在开发服务器上迁移),如果我通过git推送迁移并运行migration AppName,它将运行丢失的所有迁移吗? or just the most recent one? 还是只是最近的一个?

South keeps track of the migrations that were done in a history table. South会跟踪在历史记录表中完成的迁移。

In your production environment database, it will reflect the migrations you have done in there and once you push one or more new migrations and run migrate , it will check your migrations against the history table and do the necessary. 在生产环境中的数据库,它会反映你在那里进行的迁移,一旦你推一个或多个新的迁移和运行migrate ,它会检查你的迁移对历史表,并做必要的。

南方将进行所有剩余的迁移。

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

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