Deleting/“Rebasing” rails migrations

人走茶凉 提交于 2019-12-08 07:20:50

问题


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?


回答1:


There should be no problems, assuming you know perfectly good what to do and how to do it.

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?



来源:https://stackoverflow.com/questions/3253788/deleting-rebasing-rails-migrations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!