Rebase Rails migrations in a long running project

后端 未结 3 859
甜味超标
甜味超标 2020-12-13 06:17

In which I mean \"rebasing\" in the dictionary, rather than git definition...

I have a large, long running Rails project that has about 250 migrations, it\'s getting

3条回答
  •  没有蜡笔的小新
    2020-12-13 06:38

    To automate the merging (or squashing) of migrations, you could use the Squasher gem

    Simply install

    gem install squasher
    

    And run with a date, and migrations before that date will be merged:

    squasher 2016 # => Will merge all migration created before 2016
    

    More details in the README

提交回复
热议问题