aboutsummaryrefslogtreecommitdiffstats
path: root/railties/fresh_rakefile
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-20 16:55:39 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-20 16:55:39 +0000
commit16287608bb6836924dc210a62b1c7e70a58ea94c (patch)
tree7f237475eb8ac8ca8551711437b0305fcc6cdd53 /railties/fresh_rakefile
parent694aafaa9d06cd6c49698cc73f6dd105400313d8 (diff)
downloadrails-16287608bb6836924dc210a62b1c7e70a58ea94c.tar.gz
rails-16287608bb6836924dc210a62b1c7e70a58ea94c.tar.bz2
rails-16287608bb6836924dc210a62b1c7e70a58ea94c.zip
More postgresql rakefile tweaking #875
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@938 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/fresh_rakefile')
-rwxr-xr-xrailties/fresh_rakefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/railties/fresh_rakefile b/railties/fresh_rakefile
index 40878d3e71..da3761d799 100755
--- a/railties/fresh_rakefile
+++ b/railties/fresh_rakefile
@@ -121,6 +121,7 @@ task :clone_structure_to_test => [ :db_structure_dump, :purge_test_database ] do
end
when "postgresql"
ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"]
+ ENV['PGPORT'] = abcs["test"]["host"] if abcs["test"]["port"]
ENV['PGPASSWORD'] = abcs["test"]["password"]
`psql -U "#{abcs["test"]["username"]}" -f db/#{RAILS_ENV}_structure.sql #{abcs["test"]["database"]}`
when "sqlite", "sqlite3"
@@ -139,6 +140,7 @@ task :db_structure_dump => :environment do
File.open("db/#{RAILS_ENV}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump }
when "postgresql"
ENV['PGHOST'] = abcs[RAILS_ENV]["host"] if abcs[RAILS_ENV]["host"]
+ ENV['PGPORT'] = abcs[RAILS_ENV]["host"] if abcs[RAILS_ENV]["port"]
ENV['PGPASSWORD'] = abcs[RAILS_ENV]["password"]
`pg_dump -U "#{abcs[RAILS_ENV]["username"]}" -s -x -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}`
when "sqlite", "sqlite3"
@@ -157,6 +159,7 @@ task :purge_test_database => :environment do
ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"])
when "postgresql"
ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"]
+ ENV['PGPORT'] = abcs["test"]["host"] if abcs["test"]["port"]
ENV['PGPASSWORD'] = abcs["test"]["password"]
`dropdb -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`
`createdb -T template0 -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`