Permalink
Browse files

PostgreSQL: db:test:purge closes open database connections first. Clo…

…ses #6236.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5269 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent eaae039 commit 419226fe11e649afa8a1cd50a62dc4d5058d5860 @jeremy jeremy committed Oct 9, 2006
Showing with 4 additions and 0 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +2 −0 railties/lib/tasks/databases.rake
View
@@ -1,5 +1,7 @@
*SVN*
+* PostgreSQL: db:test:purge closes open database connections first. #6236 [alex]
+
* Fixed test:uncommitted on Windows (backslash issue) #4999 [paul@paulbutcher.com]
* Fixed migration creation to work with namespaced models, so script/generate model Gallery::Image will use create_table :gallery_images #6327 [BobSilva]
@@ -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"

0 comments on commit 419226f

Please sign in to comment.