3

I accidentally ran rake db:migrate, and then ran rake db:rollback. Now the database table I had created before is completely gone. Is there any way to undo a rollback, or should I just revert to the most recent branch?

calyxofheld
  • 1,538
  • 3
  • 24
  • 62

2 Answers2

10

You can do a rake db:migrate to perform the same migration once again.

zwippie
  • 15,050
  • 3
  • 39
  • 54
  • 2
    After some search I realized that running rake db:migrate:redo STEP=1 solves my problem. Or just plain rake db:migrate. Thanks! – calyxofheld Feb 10 '14 at 09:33
3

Just an update to existing answer by @sabaeus

If rake db:migrate doesn't work for anyone, you can use rake db:migrate:redo.

rake db:migrate is to run all current migrations.

abhimanyuaryan
  • 3,882
  • 5
  • 41
  • 83