Permalink
Browse files

Merge pull request #4132 from Juanmcuello/clone_structure

Reset postgreSQL search path in db:test:clone_structure.
  • Loading branch information...
2 parents 85c56b0 + 5662ea5 commit 1ca31331ba1234132ea6f91204059b8660c44b69 @tenderlove tenderlove committed May 26, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 activerecord/lib/active_record/railties/databases.rake
@@ -410,6 +410,7 @@ db_namespace = namespace :db do
end
`pg_dump -i -s -x -O -f #{Shellwords.escape(filename)} #{search_path} #{Shellwords.escape(abcs[Rails.env]['database'])}`
raise 'Error dumping database' if $?.exitstatus == 1
+ File.open(filename, "a") { |f| f << "SET search_path TO #{ActiveRecord::Base.connection.schema_search_path};\n\n" }
when /sqlite/
dbfile = abcs[Rails.env]['database']
`sqlite3 #{dbfile} .schema > #{filename}`

0 comments on commit 1ca3133

Please sign in to comment.