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
On 12/19/06, Mark <MEHColeman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> 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 =================================================>
========> == Test1: migrated (0.0000s)
> =================================================>
> == Test2: migrating =================================================>
========> == Test2: migrated (0.0000s)
> =================================================>
> ** Invoke db:schema:dump (first_time)
> ** Invoke environment
> ** Execute db:schema:dump
>
> F:\ror\trunk\test>rake db:migrate --trace VERSION=4
> (in F:/ror/trunk/test)
> ** Invoke db:migrate (first_time)
> ** Invoke environment (first_time)
> ** Execute environment
> ** Execute db:migrate
> == Test3: migrating =================================================>
========> == Test3: migrated (0.0000s)
> =================================================>
> == Test4: migrating =================================================>
========> == Test4: migrated (0.0000s)
> =================================================>
> ** Invoke db:schema:dump (first_time)
> ** Invoke environment
> ** Execute db:schema:dump
>
> 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
> == Test4: reverting =================================================>
========> == Test4: reverted (0.0000s)
> =================================================>
> == Test3: reverting =================================================>
========> == Test3: reverted (0.0000s)
> =================================================>
> ** Invoke db:schema:dump (first_time)
> ** Invoke environment
> ** Execute db:schema:dump
>
> F:\ror\trunk\test>
> </quote>
>
>
> Any help would be much appreciated!
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---