Fork me on GitHub

Double-check your migrations

26 Jul 2010

Jaime Iniesta

Many developers only check their migrations work on the forward step (rake db:migrate) but not so often on the backwards step (rake db:rollback).

When I create a new migration, I like to do a little sanity check to be sure it works on both ways and it's free of typos or other errors. I just mean:

rake db:migrate
rake db:rollback
rake db:migrate

Or better and simpler:

rake db:migrate
rake db:migrate:redo

Tags