Django迁移(makemigrations)是否应该与创建模型分开提交? [英] Should Django Migration (makemigrations) commited separately than creating model?

查看:85
本文介绍了Django迁移(makemigrations)是否应该与创建模型分开提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我来说,哪一种策略在 django 或任何其他Web框架的版本控制中哪个策略更好:

It's vague for me which strategy is better in Version controlling of django or any other web framework:


  1. 分别提交以创建模型和运行 makemigrations

  2. 同时提交两个任务。

我认为自己的第一个策略更好,因为在运行<$ c之后创建的 migration 文件$ c> makemigrations 。但是我需要确定哪个更好。

I think myself first strategy is better, because of migration files which creating after running makemigrations. But I need to be sure which one in better. Is there any certain standard for this?

推荐答案

您列出的两种策略都可行。但是选择一种方法更好。

Both the strategies you list can work. But option one is better.

您可以将Django迁移与其他更改分开提交,以便可以从提交历史记录中更清楚地跟踪模型的更改。

You can commit Django Migration separate with other changes, so that changes for models can be tracked more clearly from commit histories.

这篇关于Django迁移(makemigrations)是否应该与创建模型分开提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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