did you run your migrations for test environment as well?

RAILS_ENV=test rake db:migrate 

?

On Jul 25, 2011, at 15:42 , Jedrin wrote:

> 
> I am having a problem using the test database in Rails 3. It
> apparently has kept track of aspects of the database that I deleted
> completely from my migrations at some point. I don't always use the
> 'down' part of a migration and sometimes just recreate the whole
> database. I did rake db:migrate:reset and rake db:test:prepare, but
> when I run my test it is trying to access tables that are not in the
> test at all and fields that are not in that table.
> 
> test_attr_merge(UserSectionTest):
> ActiveRecord::StatementInvalid: Mysql::Error: Unknown column
> 'conversion_dir_id'
> in 'field list': INSERT INTO `conversions` (`file_name`,
> `conversion_dir_id`, `
> created_at`, `updated_at`, `id`) VALUES ('MyString', 1, '2011-07-25
> 13:32:52', '
> 2011-07-25 13:32:52', 980190962)
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/con
> nection_adapters/abstract_adapter.rb:202:in `rescue in log'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/con
> nection_adapters/abstract_adapter.rb:194:in `log'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/con
> nection_adapters/mysql_adapter.rb:289:in `execute'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/con
> nection_adapters/abstract/database_statements.rb:239:in
> `insert_fixture'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:646:in `block in insert_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:582:in `each'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:582:in `insert_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:526:in `block (4 levels) in create_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:526:in `each'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:526:in `block (3 levels) in create_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/con
> nection_adapters/abstract/database_statements.rb:139:in `transaction'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:524:in `block (2 levels) in create_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/con
> nection_adapters/mysql_adapter.rb:228:in
> `disable_referential_integrity'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:515:in `block in create_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/
> active_support/b
> enchmarkable.rb:55:in `silence'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:514:in `create_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:973:in `load_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/
> active_record/fix
> tures.rb:938:in `setup_fixtures'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/
> active_support/c
> allbacks.rb:414:in `_run_setup_callbacks'
>    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/
> active_support/t
> esting/setup_and_teardown.rb:34:in `run'
> 
> 2 tests, 0 assertions, 0 failures, 2 errors, 0 skips
> 
> Test run options: --seed 35707
> 
> -- 
> 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 [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
===============================================================================
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com  www.maxwellrender.cz  www.lightgems.cz
===============================================================================

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to