Method: ActiveRecord::Tasks::SQLiteDatabaseTasks#drop

Defined in:
lib/active_record/tasks/sqlite_database_tasks.rb

#dropObject



24
25
26
27
28
29
30
31
32
# File 'lib/active_record/tasks/sqlite_database_tasks.rb', line 24

def drop
  require "pathname"
  path = Pathname.new(db_config.database)
  file = path.absolute? ? path.to_s : File.join(root, path)

  FileUtils.rm(file)
rescue Errno::ENOENT => error
  raise NoDatabaseError.new(error.message)
end