aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-10-09 06:34:57 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-10-09 06:34:57 +0000
commit419226fe11e649afa8a1cd50a62dc4d5058d5860 (patch)
tree6e9c1eee6b5f38008dc34ea79352549f69ef07c1 /railties/lib
parenteaae0399ad205c8d5afa3130b07f4c31e0c04aac (diff)
downloadrails-419226fe11e649afa8a1cd50a62dc4d5058d5860.tar.gz
rails-419226fe11e649afa8a1cd50a62dc4d5058d5860.tar.bz2
rails-419226fe11e649afa8a1cd50a62dc4d5058d5860.zip
PostgreSQL: db:test:purge closes open database connections first. Closes #6236.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5269 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/tasks/databases.rake2
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index cd91a94416..7bc9aa9473 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -123,6 +123,8 @@ namespace :db do
ENV['PGPORT'] = abcs["test"]["port"].to_s if abcs["test"]["port"]
ENV['PGPASSWORD'] = abcs["test"]["password"].to_s if abcs["test"]["password"]
enc_option = "-E #{abcs["test"]["encoding"]}" if abcs["test"]["encoding"]
+
+ ActiveRecord::Base.clear_active_connections!
`dropdb -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`
`createdb #{enc_option} -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`
when "sqlite","sqlite3"