Skip to content

Commit

Permalink
Merge pull request #4132 from Juanmcuello/clone_structure
Browse files Browse the repository at this point in the history
Reset postgreSQL search path in db:test:clone_structure.
  • Loading branch information
tenderlove committed May 26, 2012
2 parents 85c56b0 + 5662ea5 commit 1ca3133
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions activerecord/lib/active_record/railties/databases.rake
Expand Up @@ -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}`
Expand Down

0 comments on commit 1ca3133

Please sign in to comment.