Permalink
Browse files

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>
  • Loading branch information...
1 parent 2909626 commit 071f48b716ce2cd8a46219730afc307c258a9798 bastilian committed with lifo May 12, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/tasks/databases.rake
@@ -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']

0 comments on commit 071f48b

Please sign in to comment.