blob: a72ec0175b2c162062a550d8e01ff5eb8ed7752f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
class ActiveRecord::Tasks::DatabaseTasks
def self.create(configuration)
if File.exist?(configuration['database'])
$stderr.puts "#{configuration['database']} already exists"
return
end
ActiveRecord::Base.establish_connection(configuration)
ActiveRecord::Base.connection
rescue Exception => e
$stderr.puts e, *(e.backtrace)
$stderr.puts "Couldn't create database for #{configuration.inspect}"
end
end
|