by
back

Rerun a single rails migration

To run down and then up from a migration:

rake db:migrate:redo VERSION=xxxxxxx

run only up

rake db:migrate:up VERSION=xxxxxxx

run only down

rake db:migrate:down VERSION=xxxxxxx

rerun a migration in the rails console

rails c
require 'db/migrate/your_migrations.rb'
YourMigrations.down
YourMigrations.up
YourMigrations.new.migrate(:up)
YourMigrations.new.migrate(:down)


comments powered by Disqus