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