jpw
jpw

Reputation: 19247

rails: any way to run ONLY the NEXT migration (of several new migrations), do manual stuff, then run the rest of the migrations?

My Rails 3.0 app has three new migrations pending, X and Y and Z, but some manual intervention is required after running X and before running Y and Z.

Is there a way to tell rake "run anything pending up to and including X" (then do my manual stuff)?

After that manual cleanup of course I can just run the normal rake db:migrate and it'll catch up with the rest.

(In the future, if we clone and rebuild the app from scratch someday it is not a problem to run them all at once. It's a a matter of one-time massaging the legacy data between those two migrations.)

Upvotes: 1

Views: 434

Answers (1)

Marten
Marten

Reputation: 1356

rake db:migrate:up VERSION=X

# do your stuff

rake db:migrate

Source: Migrations-Guide

Upvotes: 2

Related Questions