Is "rake db:test:prepare" support to (a) setup FK constraint

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

(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/6/07, Greg H. [email protected] 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs