aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-02-15 23:16:01 +0000
committerMichael Koziarski <michael@koziarski.com>2008-02-15 23:16:01 +0000
commit3028ca59559d4c39412cdb8e4211ac6e1bded413 (patch)
tree729e17047bee10934650f6cd8cf1a2e56008459f
parentf3fd2b18b743413d2260f4d54c63ef7375053fd7 (diff)
downloadrails-3028ca59559d4c39412cdb8e4211ac6e1bded413.tar.gz
rails-3028ca59559d4c39412cdb8e4211ac6e1bded413.tar.bz2
rails-3028ca59559d4c39412cdb8e4211ac6e1bded413.zip
Clear active connections before trying to drop the database. Allows db:drop to work with posgresql. Closes #10559 [jqr]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8876 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/lib/tasks/databases.rake1
1 files changed, 1 insertions, 0 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index 7d18df1873..00c0fa4072 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -344,6 +344,7 @@ def drop_database(config)
when /^sqlite/
FileUtils.rm(File.join(RAILS_ROOT, config['database']))
when 'postgresql'
+ ActiveRecord::Base.clear_active_connections!
`dropdb "#{config['database']}"`
end
end