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 ==================================================