1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

establish mysql connection before dropping database

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#63 state:committed]
This commit is contained in:
Aliaksey Kandratsenka 2008-11-28 17:09:46 +02:00 committed by Michael Koziarski
parent a8fc494dbb
commit a0bc480e1d

View file

@ -398,6 +398,7 @@ end
def drop_database(config)
case config['adapter']
when 'mysql'
ActiveRecord::Base.establish_connection(config)
ActiveRecord::Base.connection.drop_database config['database']
when /^sqlite/
FileUtils.rm(File.join(RAILS_ROOT, config['database']))