What is the best way to resolve Rails orphaned migrations?

后端 未结 10 1000
陌清茗
陌清茗 2020-12-22 22:29

I have been switching between branches in a project and each of them have different migrations... This is the scenario:

$ rake db:migrate:status

<
10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-22 23:21

    create new files with names like 20130320144219_migration_1 put some blank code into

    class Migration1 < ActiveRecord::Migration 
      def change; end 
    end 
    

    and run command rails db:migrate:down VERSION= 20130320144219 and at last - remove this files

提交回复
热议问题