3

Somehow my test environment forgot to copy over several migrations. In order to troubleshoot, I want to call certain migration files by hand.

Is there a rake db:migrate option or trick that allows me to pass in a directory full of migrations that should be ran? Or even a specific migration file that will be ran?

These migrations are not present under db/migrate/, but rather in another gems' migration folder (/home/ber/.rvm/gems/ruby-1.8.7-p302@xxx/gems/spree_auth-1.0.0/db/migrate/).

berkes
  • 26,996
  • 27
  • 115
  • 206

2 Answers2

6

If you generate your migrations with a specific version then this post will help you with that.

From post:

rake db:migrate:up VERSION=20090408054532

Where VERSION= is set to whatever comes from your generation.

Community
  • 1
  • 1
ScottJShea
  • 7,041
  • 11
  • 44
  • 67
2

try running this

rake db:migrate:status

you will find a table with all your migrations

choose the version you would like to migrate or unmigrate then

rake db:migrate VERSION=201853073732  

Notice that this won't work if you are stuck in mid migrations if you are you have to comment out the lines that were already migrated Good luck

Shahin
  • 2,507
  • 1
  • 13
  • 17