Hey folks-- I''m currently on tag/rel_1-2-3 and have a problem I haven''t encountered before. I''ve got about 55 total migrations in my database. With this most recent one, I migrate the test database: rake RAILS_ENV=test db:migrate Then I run the unit tests: rake test:units Several fail, even though they succeed when run individually. Upon inspection, I realized that my ''schema_info'' has gone back to its previous value. Any idea why this would be happening? Jake -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ok... So I just ran my migration on RAILS_ENV=development and now "rake test:units" succeeds and does not rollback my test database. Is there some linkage here that shouldn''t be there? I tried this because I noticed a DEPRECATION warning that came up in ''environments/development.rb" and I couldn''t figure out why rake test:units was running my development environment. It still, of course, uses the test database. A little confused, Jake Jake Janovetz wrote:> Hey folks-- > > I''m currently on tag/rel_1-2-3 and have a problem I haven''t encountered > before. I''ve got about 55 total migrations in my database. With this > most recent one, I migrate the test database: > > rake RAILS_ENV=test db:migrate > > Then I run the unit tests: > > rake test:units > > Several fail, even though they succeed when run individually. Upon > inspection, I realized that my ''schema_info'' has gone back to its > previous value. Any idea why this would be happening? > > Jake-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 9/5/07, Jake Janovetz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Ok... So I just ran my migration on RAILS_ENV=development and now "rake > test:units" succeeds and does not rollback my test database. > > Is there some linkage here that shouldn''t be there? I tried this > because I noticed a DEPRECATION warning that came up in > ''environments/development.rb" and I couldn''t figure out why rake > test:units was running my development environment. > > It still, of course, uses the test database.rake test:units calls db:test:prepare, which clones your development schema to your test schema. That''s what''s wiping out your migrations. You should not run migrations on the test environment. Run them on the development environment before running your tests. Also, if you use autotest (which rocks by the way), you need to run rake db:test:prepare manually after the migration. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bob Showalter wrote:> On 9/5/07, Jake Janovetz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> Ok... So I just ran my migration on RAILS_ENV=development and now "rake >> test:units" succeeds and does not rollback my test database. >> >> Is there some linkage here that shouldn''t be there? I tried this >> because I noticed a DEPRECATION warning that came up in >> ''environments/development.rb" and I couldn''t figure out why rake >> test:units was running my development environment. >> >> It still, of course, uses the test database. > > rake test:units calls db:test:prepare, which clones your development > schema to your test schema. That''s what''s wiping out your migrations. > > You should not run migrations on the test environment. Run them on the > development environment before running your tests. Also, if you use > autotest (which rocks by the way), you need to run rake > db:test:prepare manually after the migration.Ah. I see. Thanks for that explanation. I occasionally run the migration on test first while I''m still testing the migration to avoid messing up the development database. (since MySQL doesn''t support transactional migrations -- if a migration fails, I have to fiddle with it by hand to get things back) Jake -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---