aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/tasks/databases.rake
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/tasks/databases.rake')
-rw-r--r--railties/lib/tasks/databases.rake4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index 87fde7a958..4a2efa98ee 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -44,7 +44,9 @@ task :db_structure_dump => :environment do
ENV['PGHOST'] = abcs[RAILS_ENV]["host"] if abcs[RAILS_ENV]["host"]
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"]
- `pg_dump -U "#{abcs[RAILS_ENV]["username"]}" -s -x -O -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}`
+ search_path = abcs[RAILS_ENV]["schema_search_path"]
+ search_path = "--schema=#{search_path}" if search_path
+ `pg_dump -U "#{abcs[RAILS_ENV]["username"]}" -s -x -O -f db/#{RAILS_ENV}_structure.sql #{search_path} #{abcs[RAILS_ENV]["database"]}`
when "sqlite", "sqlite3"
`#{abcs[RAILS_ENV]["adapter"]} #{abcs[RAILS_ENV]["dbfile"]} .schema > db/#{RAILS_ENV}_structure.sql`
when "sqlserver"