Greg Hauptmann
2007-Jun-02 06:43 UTC
is "rake db:test:prepare" support to (a) setup FK constraints & (b) run in my test data migration????
Hi, Just noting (as I start to use unit tests) that when I issue "rake db:test:prepare" that what I do NOT see in my test database (as I do in development when running "rake db:migrate"): (a) FK constraints don''t seem to be put in place in my test database. Extract from the migration def self.up down directory = File.join(File.dirname(__FILE__), "dev_data") Fixtures.create_fixtures(directory, "donations") Fixtures.create_fixtures(directory, "donation_events") Fixtures.create_fixtures(directory, "comments") end (b) Test Data wasn''t loaded - I had one of my migrations that had test data I was loading. This didn''t seem to get loaded. Is this expected? Should "rake db:test:prepare" not emulate the same as running "rake db:migrate" in development? Thanks Greg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Greg Hauptmann
2007-Jun-06 20:13 UTC
Re: is "rake db:test:prepare" support to (a) setup FK constraints & (b) run in my test data migration????
(bump) - i.e. Should "rake db:test:prepare" not emulate the same as running "rake db:migrate" in development? (e.g. creation of same FK constraints) On 6/2/07, Greg Hauptmann <greg.hauptmann.ruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > Just noting (as I start to use unit tests) that when I issue "rake > db:test:prepare" that what I do NOT see in my test database (as I do in > development when running "rake db:migrate"): > > (a) FK constraints don''t seem to be put in place in my test database. > Extract from the migration > def self.up > down > directory = File.join(File.dirname(__FILE__), "dev_data") > Fixtures.create_fixtures (directory, "donations") > Fixtures.create_fixtures(directory, "donation_events") > Fixtures.create_fixtures(directory, "comments") > end > > (b) Test Data wasn''t loaded - I had one of my migrations that had test > data I was loading. This didn''t seem to get loaded. > > Is this expected? Should "rake db:test:prepare" not emulate the same as > running "rake db:migrate" in development? > > Thanks > Greg >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Isak Hansen
2007-Jun-07 08:29 UTC
Re: is "rake db:test:prepare" support to (a) setup FK constraints & (b) run in my test data migration????
On 6/6/07, Greg Hauptmann <greg.hauptmann.ruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> (bump) - i.e. Should "rake db:test:prepare" not emulate the same as running > "rake db:migrate" in development? (e.g. creation of same FK constraints) >db:test:prepare runs either db:test:clone, or db:test:clone_structure, based on whether config.active_record.schema_format is :ruby or :sql. I assume that clone_structure (i.e. :sql) is least likely to ignore your FKs. You''ll find the code for the db tasks at <http://dev.rubyonrails.org/browser/trunk/railties/lib/tasks/databases.rake>. HTH, Isak --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---