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

前端 未结 10 1686
清歌不尽
清歌不尽 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 12:02

    I occasionally purge all migrations, which have already been applied in production and I see at least 2 reasons for this:

    1. More manageable folder. It is easier to spot if some new migration is added.
    2. Cleaner text search results (Global text search within a project does not lead to tons of useless matches because of old migration, say, when someone created some column 3 years ago).

提交回复
热议问题