From 47542d453950ee1d4dbea40092a595c6884f0aa8 Mon Sep 17 00:00:00 2001 From: James Kebinger Date: Thu, 16 Apr 2009 12:30:46 -0400 Subject: [PATCH] structure:dump task should work for multiple schemas in postgres --- railties/lib/tasks/databases.rake | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index 9588fab..e2daf42 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -273,7 +273,7 @@ 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 + search_path = search_path.split(',').map{|p| "--schema=#{p.strip}"}.join(' ') if search_path `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