diff options
author | Jeff Dean <jeff@zilkey.com> | 2009-05-22 00:32:32 -0400 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2009-06-01 12:12:45 +1200 |
commit | b3839f1c98ab6824091c517f6e2e6e3a024c3e13 (patch) | |
tree | a0ec3a67054b67639ca194c7b98523748c8ebc1f /railties | |
parent | 64756e8f718c90a17664f2d35993696d8bf0f81e (diff) | |
download | rails-b3839f1c98ab6824091c517f6e2e6e3a024c3e13.tar.gz rails-b3839f1c98ab6824091c517f6e2e6e3a024c3e13.tar.bz2 rails-b3839f1c98ab6824091c517f6e2e6e3a024c3e13.zip |
Updated the db:structure:dump task to properly format the pgdump command when you have multiple schemas in your schema search path.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2695 state:committed]
Diffstat (limited to 'railties')
-rw-r--r-- | 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 f572e914e1..0e256737f9 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -298,7 +298,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" |