From fee394c3fb8af33b2d5e20696a0a88815bce83e9 Mon Sep 17 00:00:00 2001 From: Jeff Dean Date: Fri, 22 May 2009 00:32:32 -0400 Subject: [PATCH] Updated the db:structure:dump task to properly format the pgdump command when you have multiple schemas in your schema search path. --- railties/lib/tasks/databases.rake | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index cdab5d8..27c7d0d 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -282,7 +282,9 @@ namespace :db do ENV['PGPORT'] = abcs[RAILS_ENV]["port"].to_s if abcs[RAILS_ENV]["port"] ENV['PGPASSWORD'] = abcs[RAILS_ENV]["password"].to_s if abcs[RAILS_ENV]["password"] search_path = abcs[RAILS_ENV]["schema_search_path"] - search_path = "--schema=#{search_path}" if search_path + unless search_path.blank? + search_path = search_path.split(",").map{|search_path| "--schema=#{search_path.strip}" }.join(" ") + end `pg_dump -i -U "#{abcs[RAILS_ENV]["username"]}" -s -x -O -f db/#{RAILS_ENV}_structure.sql #{search_path} #{abcs[RAILS_ENV]["database"]}` raise "Error dumping database" if $?.exitstatus == 1 when "sqlite", "sqlite3" -- 1.6.0.2