简体   繁体   English

如何在django 1.7中管理开发人员之间的迁移?

[英]How to manage migrations in django 1.7 among developers?

We are 2 developers working on a django application. 我们是2个致力于Django应用程序的开发人员。 As we are in the initial stages of the app our models are changing rapidly and so are django migration files. 当我们处于应用程序的初始阶段时,我们的模型正在快速变化,Django迁移文件也在快速变化。 So if one of us pushes the migrations to git and when the other one pulls them and tries to apply them, django is not able to find a common migration point as he also would have made some model changes. 因此,如果我们中的一个将迁移推到git上,而当另一个将其拉到git并尝试应用它们时,django将无法找到一个通用的迁移点,因为他也会进行一些模型更改。 Please suggest a clean way to resolve this issue. 请提出一种干净的方法来解决此问题。

so there are developers A and B. 因此有开发商A和开发商B。

if it is very important you both have notification enabled in git so that you know what your friend has pushed. 如果这很重要,则您都在git中启用了通知,以便您知道朋友推送了什么。

lets imagine, A and B are working at the same time on same django app, possibly on the same models.py. 想象一下,A和B在同一django应用程序(可能在同一model.py)上同时工作。

if A pushes changes on models.py, B needs to apply these changes in his local version before he pushes. 如果A推送了对models.py的更改,则B需要在推送之前在其本地版本中应用这些更改。 if B pushes his changes, A needs to apply them first before he pushes. 如果B推动更改,则A必须先应用更改,然后再推动。 in this way, both local versions will have the same migration history. 这样,两个本地版本将具有相同的迁移历史记录。 this is how I do with my friends.. 这就是我和朋友们在一起的方式。

any improvement to what i say is highly appreciated 我所说的任何改进都受到赞赏

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

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