Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Skip databases that couldn't be created.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6900 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit a1c88273f4321e203ccf389ccff8a8e043c4f8f9 1 parent 186ac4c
@jeremy jeremy authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 railties/lib/tasks/databases.rake
View
10 railties/lib/tasks/databases.rake
@@ -12,9 +12,13 @@ namespace :db do
@charset = ENV['CHARSET'] || 'utf8'
@collation = ENV['COLLATION'] || 'utf8_general_ci'
- ActiveRecord::Base.establish_connection(config.merge({'database' => nil}))
- ActiveRecord::Base.connection.create_database(config['database'], {:charset => @charset, :collation => @collation})
- ActiveRecord::Base.establish_connection(config)
+ begin
+ ActiveRecord::Base.establish_connection(config.merge({'database' => nil}))
+ ActiveRecord::Base.connection.create_database(config['database'], {:charset => @charset, :collation => @collation})
+ ActiveRecord::Base.establish_connection(config)
+ rescue
+ $stderr.puts "Couldn't create database for #{config.inspect}"
+ end
when 'postgresql'
`createdb "#{config['database']}" -E utf8`
when 'sqlite'
Please sign in to comment.
Something went wrong with that request. Please try again.