Is it a good idea to purge old Rails migration files?

前端 未结 10 1673
清歌不尽
清歌不尽 2021-01-01 11:16

I have been running a big Rails application for over 2 years and, day by day, my ActiveRecord migration folder has been growing up to over 150 files.

There are very

10条回答
  •  悲哀的现实
    2021-01-01 11:51

    Why? Unless there is some kind of problem with disk space, I don't see a good reason for deleting them. I guess if you are absolutely certain that you are never going to roll back anything ever again, than you can. However, it seems like saving a few KB of disk space to do this wouldn't be worth it. Also, if you just want to delete the migrations that refer to old models, you have to look through them all by hand to make sure you don't delete anything that is still used in your app. Lots of effort for little gain, to me.

提交回复
热议问题