Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5925 from Juanmcuello/pg_structure_dump

Quote arguments in db:structure:dump for PostgreSQL.
  • Loading branch information...
commit 6775ad8c61b18e0df2df7c7103478d4f315c0cb3 1 parent b0ebdf3
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/railties/databases.rake
View
4 activerecord/lib/active_record/railties/databases.rake
@@ -406,9 +406,9 @@ db_namespace = namespace :db do
set_psql_env(abcs[Rails.env])
search_path = abcs[Rails.env]['schema_search_path']
unless search_path.blank?
- search_path = search_path.split(",").map{|search_path_part| "--schema=#{search_path_part.strip}" }.join(" ")
+ search_path = search_path.split(",").map{|search_path_part| "--schema=#{Shellwords.escape(search_path_part.strip)}" }.join(" ")
end
- `pg_dump -i -s -x -O -f #{filename} #{search_path} #{abcs[Rails.env]['database']}`
+ `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
when /sqlite/
dbfile = abcs[Rails.env]['database']
Please sign in to comment.
Something went wrong with that request. Please try again.