删除/“重新设置”。 Rails迁移 [英] Deleting/"Rebasing" rails migrations

查看:100
本文介绍了删除/“重新设置”。 Rails迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在Rails网站一部分的git分支中工作。我在迭代时对架构进行了许多随机更改,并且进行了一些迁移,这些迁移还原了以前的迁移以添加列和类似的内容。是否可以删除像这样的冗余迁移(即成对的反向迁移)?我不明白为什么会引起任何问题,因为没有人在这个分支上工作,最终结果是相同的。

I've been working in a git branch on one portion of a rails site. I've made a lot of random changes to the schema while iterating, and I've made some migrations that revert previous migrations to add columns and things like that. Is it OK to delete redundant migrations like those (i.e. pairs of migrations that are just reverses of each other)? I don't see why it would cause any problems because no one else is working on this branch, and the end result will be the same. Is there any chance of trouble if I go ahead with this?

推荐答案

应该应该没有问题

但是,您应该问自己为什么要这样做?它没有添加到您的项目中。它只会掩盖(部分)您的迭代,这可能会方便以后查看以了解您的工作过程或向其他人解释它。

But, you should ask yourself why you want to do this? It is no addition to your project. It only masks (some of) your iterations, which might be convenient to look back later to understand your working process or to explain it to someone else.

我个人而言,只需将您的分支与主分支合并,而根本不删除任何更改。没什么不好意思的事吗?

Personally, I would just merge your branch with the main branch without deleting any changes at all. Nothing to be ashamed of right?

这篇关于删除/“重新设置”。 Rails迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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