# Migrate problem (have to go back, then forward, to "stick")

**URL:** <https://www.ruby-forum.com/t/migrate-problem-have-to-go-back-then-forward-to-stick/82396>\
**Category:** Rails\
**Created:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/migrate-problem-have-to-go-back-then-forward-to-stick/82396 "2007-01-19T16:30:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dankelley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c77e96/32.png) [@dankelley](https://www.ruby-forum.com/u/dankelley)\
**Post date:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/migrate-problem-have-to-go-back-then-forward-to-stick/82396/1 "2007-01-19T16:30:04Z")

</div>

I wonder if I’m reading the various tutorials (and Agile book, version  
2) incorrectly…

I make an app, and then edit e.g. by adding a new column to  
migrate/002\_stuff.db  
and then run  
rake migrate  
rake db:structure:dump && cat db/development\_structure.sql  
but I see no change in the database.

However, the database _is_ updated if I do  
rake migrate VERSION=0  
rake migrate

But isn’t one supposed just to edit the migrate/\*.rb files and do  
rake migrate  
?

---

<div class="post-metadata">

**Author:** ![dankelley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c77e96/32.png) [@dankelley](https://www.ruby-forum.com/u/dankelley)\
**Post date:** [January 19, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/migrate-problem-have-to-go-back-then-forward-to-stick/82396/2 "2007-01-19T16:31:25Z")

</div>

dankelley wrote:

> However, the database _is_ updated if I do  
> rake migrate VERSION=0  
> rake migrate
> 
> But isn’t one supposed just to edit the migrate/\*.rb files and do  
> rake migrate  
> ?
> 
> >

When you just run rake migrate you are telling the system to run all the  
migration files that are a higher number than your current db version.  
If you are already at version 2 and you run rake migrate after editing  
002\_stuff.rb nothing new will happen. When you run rake migrate  
VERSION=0 then you are resetting things so 002\_stuff.rb is a newer  
file(2) than your db state(0).

Matt M.  
[blog.mattmargolis.net](http://blog.mattmargolis.net)
