mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Make sure db:drop doesn't fail when sqlite db is given by an absolute path [#1789 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
@@ -440,7 +440,7 @@ def drop_database(config)
|
||||
ActiveRecord::Base.establish_connection(config)
|
||||
ActiveRecord::Base.connection.drop_database config['database']
|
||||
when /^sqlite/
|
||||
FileUtils.rm(File.join(RAILS_ROOT, config['database']))
|
||||
FileUtils.rm((config['database'] =~ /^\// ? config['database'] : File.join(RAILS_ROOT, config['database'])))
|
||||
when 'postgresql'
|
||||
ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
|
||||
ActiveRecord::Base.connection.drop_database config['database']
|
||||
|
||||
Reference in New Issue
Block a user