exactly what does rake db:migrate do?

前端 未结 3 1427
孤独总比滥情好
孤独总比滥情好 2021-02-07 00:58

Does rake db:migrate only add new migrations, or does it drop all migrations/changes and build everything new?

I think rake is throwing an error because it is trying to

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-07 01:34

    A migration means that you move from the current version to a newer version (as is said in the first answer). Using rake db:migrate you can apply any new changes to your schema. But if you want to rollback to a previous migration you can use rake db:rollback to nullify your new changes if they are incorrectly defined. Caution: by doing so your data will be lost.

提交回复
热议问题