What is the best way to resolve Rails orphaned migrations?

后端 未结 10 949
陌清茗
陌清茗 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:35

    You could merge the two branches back into the master so that you have all migrations available. If you really don't want those migrations there, but want to be able to roll back, you could edit the schema_migrations table in your database to remove the rows corresponding to the migrations for which you don't have files. However, this will cause problems if you then switch to another branch with different migrations.

提交回复
热议问题