# rake redo??

**URL:** <https://discuss.rubyonrails.org/t/rake-redo/42701>\
**Category:** rubyonrails-talk\
**Created:** [May 20, 2009, 9:11pm UTC](https://discuss.rubyonrails.org/t/rake-redo/42701 "2009-05-20T21:11:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [May 20, 2009, 9:11pm UTC](https://discuss.rubyonrails.org/t/rake-redo/42701/1 "2009-05-20T21:11:54Z")

</div>

> Being someone who likes to write code and do everything myself this rails deal has me grinding my teeth, but I will get over it.
> 
> I just noticed after doing a "rake db:migrate" that I mispelled a method/column name. So before doing anything else, I corrected the spelling in the relevant db/migrate .rb file and ran "rake db:migrate" again hoping that would do. However, looking in the db/schema.rb file, nothing had changed. So I erased that and the database and tried rake again and hopefully everything is fine BUT that is hackish, to say the least.

rake db:rollback rolls back the last migration you've run

> I've only glanced through the rake docs, --help, etc, and can't find anything pertinent to the issue. Anyone nice wanna explain quick?

rake is a fairly generic ruby tool, so the rake documentation is unlikely to be helpful. in a given context (eg inside your rails folder) rake -T will list available tasks. The migrations guide ( [Active Record Migrations — Ruby on Rails Guides](http://guides.rubyonrails.org/migrations.html#running-migrations) ) has some more info.

> The other part of my question: does rake affect anything outside db/ ?

rake tasks are arbitrary ruby code. in theory you could have a rake task that launched a missile at the moon. The tasks that rails provides in the db: namespace do just fiddle with the database (or related files like schema.rb)

Fred

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [May 20, 2009, 10:28pm UTC](https://discuss.rubyonrails.org/t/rake-redo/42701/2 "2009-05-20T22:28:09Z")

</div>

Frederick Cheung wrote:

> rake tasks are arbitrary ruby code. in theory you could have a rake task that launched a missile at the moon. The tasks that rails provides in the db: namespace do just fiddle with the database (or related files like schema.rb)
> 
> Fred

Thanks all!

---

<div class="post-metadata">

**Author:** ![Brendon1](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@Brendon1](https://discuss.rubyonrails.org/u/Brendon1)\
**Post date:** [May 21, 2009, 12:10am UTC](https://discuss.rubyonrails.org/t/rake-redo/42701/3 "2009-05-21T00:10:33Z")

</div>

Surprised nobody mentioned: rake db:migrate:redo VERSION=\<xxx\>

It lets you redo a single migration, don't forget to dump the table and then reload it if you want to keep the data.

Brendon.
