aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-03-31 21:16:17 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-03-31 21:16:17 +0000
commitc4be0dbca96797547a9673368d17de22bdec52b7 (patch)
tree89627bf2ac1a8fa206e57b5db600646d5b3f0df7
parent92cd8811aa3e113053a37bccb39cf5f09d9ef84d (diff)
downloadrails-c4be0dbca96797547a9673368d17de22bdec52b7.tar.gz
rails-c4be0dbca96797547a9673368d17de22bdec52b7.tar.bz2
rails-c4be0dbca96797547a9673368d17de22bdec52b7.zip
Fixed charset/collation for rake db:create (closes #11331) [matt]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9170 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/lib/tasks/databases.rake4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index 40b60c1959..f6a1f73731 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -37,10 +37,10 @@ namespace :db do
@collation = ENV['COLLATION'] || 'utf8_general_ci'
begin
ActiveRecord::Base.establish_connection(config.merge({'database' => nil}))
- ActiveRecord::Base.connection.create_database(config['database'], {:charset => (config['database']['charset'] || @charset), :collation => (config['database']['charset'] || @collation)})
+ ActiveRecord::Base.connection.create_database(config['database'], {:charset => (config['charset'] || @charset), :collation => (config['collation'] || @collation)})
ActiveRecord::Base.establish_connection(config)
rescue
- $stderr.puts "Couldn't create database for #{config.inspect}, charset: #{@charset}, collation: #{@collation} (if you set the charset manually, make sure you have a matching collation)"
+ $stderr.puts "Couldn't create database for #{config.inspect}, charset: #{config['charset'] || @charset}, collation: #{config['collation'] || @collation} (if you set the charset manually, make sure you have a matching collation)"
end
when 'postgresql'
`createdb "#{config['database']}" -E utf8`