diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-10-29 17:07:49 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-10-29 17:07:49 +0000 |
commit | 39ada91f8095f08a528ff84b5c880a1459f89145 (patch) | |
tree | 7e29e0eefceecdbb0c5ece319aebb10727313e71 /railties/lib/tasks | |
parent | 2af3743ba251e45c7d5467c36913d1f0377132d7 (diff) | |
download | rails-39ada91f8095f08a528ff84b5c880a1459f89145.tar.gz rails-39ada91f8095f08a528ff84b5c880a1459f89145.tar.bz2 rails-39ada91f8095f08a528ff84b5c880a1459f89145.zip |
The PostgreSQL :db_structure_dump task limits its dump to the schema search path in database.yml.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2814 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/tasks')
-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 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" |