# Migrations aren't migrating..

**URL:** <https://discuss.rubyonrails.org/t/migrations-arent-migrating/6069>\
**Category:** rubyonrails-talk\
**Created:** [December 19, 2006, 8:06pm UTC](https://discuss.rubyonrails.org/t/migrations-arent-migrating/6069 "2006-12-19T20:06:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark13](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@Mark13](https://discuss.rubyonrails.org/u/Mark13)\
**Post date:** [December 19, 2006, 8:06pm UTC](https://discuss.rubyonrails.org/t/migrations-arent-migrating/6069/1 "2006-12-19T20:06:33Z")

</div>

I have an odd problem with migrations which is driving me mental!

Originally, I had several migrations, but rake didn't seem to want to get past migration number 2. I thought this might have something to do with the third migration being generated via "rake db:sessions:create" However, I've subsequently trimmed it down to the following example, and the same problem occurs:

I'm not getting any errors, it seams as though it thinks everything is working as it should, but I disagree! Below is an example... starting with an empty database and 0 files in my migration folder, I create 4 blank migrations (with stub 'up' and 'down' methods). When I run "rake db:migrate" it updates to version 2. When I run "rake db:migrate VERSION=4" it processes the other two files (which I think it should have done before). If I then run "rake db:migrate" again, it rolls-back to version 2.

In the code below, I ran it with the --trace option, but that doesn't mean much to me ... \<quote\> F:\ror\trunk\test\>ruby script/generate migration test\_1 exists db/migrate create db/migrate/001\_test1.rb

F:\ror\trunk\test\>ruby script/generate migration test\_2 exists db/migrate create db/migrate/002\_test2.rb

F:\ror\trunk\test\>ruby script/generate migration test\_3 exists db/migrate create db/migrate/003\_test3.rb

F:\ror\trunk\test\>ruby script/generate migration test\_4 exists db/migrate create db/migrate/004\_test4.rb

F:\ror\trunk\test\>rake db:migrate --trace (in F:/ror/trunk/test) \*\* Invoke db:migrate (first\_time) \*\* Invoke environment (first\_time) \*\* Execute environment \*\* Execute db:migrate == Test1: migrating ==================================================

---

<div class="post-metadata">

**Author:** ![Jason\_Roelofs](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jason\_Roelofs](https://discuss.rubyonrails.org/u/Jason_Roelofs)\
**Post date:** [December 19, 2006, 8:20pm UTC](https://discuss.rubyonrails.org/t/migrations-arent-migrating/6069/2 "2006-12-19T20:20:49Z")

</div>

The only thing I can think of is somewhere VERSION is set to 2. Remember that with Rake, such arguments are in-fact set in the system environment (ENV). When you specify VERSION=4, you overwrite the value, otherwise it’s back to 2. Check your environment settings, and make sure that there isn’t a config file setting VERSION=2 for some strange reason.

Jason

---

<div class="post-metadata">

**Author:** ![Mark13](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@Mark13](https://discuss.rubyonrails.org/u/Mark13)\
**Post date:** [December 19, 2006, 9:44pm UTC](https://discuss.rubyonrails.org/t/migrations-arent-migrating/6069/3 "2006-12-19T21:44:54Z")

</div>

You were correct! Thanks, I would not have figured that out in a million years!
