提交 b9660bda 编写于 作者: R Rafael Mendonça França

Merge pull request #6765 from frodsan/fix_build_railties

Fix build: check if sqlite3 file exists before remove
class ActiveRecord::Tasks::SQLiteDatabaseTasks
delegate :connection, :establish_connection, :to => ActiveRecord::Base
delegate :connection, :establish_connection, to: ActiveRecord::Base
def initialize(configuration, root = Rails.root)
@configuration, @root = configuration, root
end
def create
if File.exist? configuration['database']
if File.exist?(configuration['database'])
$stderr.puts "#{configuration['database']} already exists"
return
end
......@@ -20,7 +20,7 @@ def drop
path = Pathname.new configuration['database']
file = path.absolute? ? path.to_s : File.join(root, path)
FileUtils.rm(file)
FileUtils.rm(file) if File.exist?(file)
end
alias :purge :drop
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册