1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Rely on quieter db:test:load task

This commit is contained in:
Jeremy Kemper 2008-06-17 03:52:01 -07:00
parent e328bdaab6
commit 6ffe32160e

View file

@ -264,13 +264,15 @@ namespace :db do
end
namespace :test do
desc "Recreate the test database from the current environment's database schema"
task :clone => %w(db:schema:dump db:test:purge) do
desc "Recreate the test database from the current schema.rb"
task :load => 'db:test:purge' do
ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])
ActiveRecord::Schema.verbose = false
Rake::Task["db:schema:load"].invoke
end
desc "Recreate the test database from the current environment's database schema"
task :clone => %w(db:schema:dump db:test:load)
desc "Recreate the test databases from the development structure"
task :clone_structure => [ "db:structure:dump", "db:test:purge" ] do
@ -340,7 +342,7 @@ namespace :db do
desc 'Check for pending migrations and load the test schema'
task :prepare => 'db:abort_if_pending_migrations' do
if defined?(ActiveRecord) && !ActiveRecord::Base.configurations.blank?
Rake::Task[{ :sql => "db:test:clone_structure", :ruby => "db:schema:load" }[ActiveRecord::Base.schema_format]].invoke
Rake::Task[{ :sql => "db:test:clone_structure", :ruby => "db:test:load" }[ActiveRecord::Base.schema_format]].invoke
end
end
end