Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 9170

Show
Ignore:
Timestamp:
03/31/08 21:16:17 (3 months ago)
Author:
david
Message:

Fixed charset/collation for rake db:create (closes #11331) [matt]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/lib/tasks/databases.rake

    r9126 r9170  
    3838        begin 
    3939          ActiveRecord::Base.establish_connection(config.merge({'database' => nil})) 
    40           ActiveRecord::Base.connection.create_database(config['database'], {:charset => (config['database']['charset'] || @charset), :collation => (config['database']['charset'] || @collation)}) 
     40          ActiveRecord::Base.connection.create_database(config['database'], {:charset => (config['charset'] || @charset), :collation => (config['collation'] || @collation)}) 
    4141          ActiveRecord::Base.establish_connection(config) 
    4242        rescue 
    43           $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)" 
     43          $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)" 
    4444        end 
    4545      when 'postgresql'