Live to Code

code to live

Handy Rake Migration Tasks


17 Apr 2012 | , , ,

  • Run Pending Migrations

     $ rake db:migrate
    
  • Rollback last migration

     $ rake db:rollback
    
  • Rollback several migrations

     $ rake db:rollback STEP=3
    
  • Rerun last/several migrations

     $ rake db:migrate:redo (STEP=3)
    
  • Recreate the database from scratch

     $ rake db:drop db:create db:migrate