mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use configuration['encoding'], because database configuration use not charset but encoding.
This commit is contained in:
parent
ccc6910cb0
commit
df9e135281
2 changed files with 5 additions and 5 deletions
|
@ -27,7 +27,7 @@ module ActiveRecord
|
|||
rescue error_class => error
|
||||
$stderr.puts error.error
|
||||
$stderr.puts "Couldn't create database for #{configuration.inspect}, #{creation_options.inspect}"
|
||||
$stderr.puts "(If you set the charset manually, make sure you have a matching collation)" if configuration['charset']
|
||||
$stderr.puts "(If you set the charset manually, make sure you have a matching collation)" if configuration['encoding']
|
||||
end
|
||||
|
||||
def drop
|
||||
|
@ -75,7 +75,7 @@ module ActiveRecord
|
|||
|
||||
def creation_options
|
||||
{
|
||||
charset: (configuration['charset'] || DEFAULT_CHARSET),
|
||||
charset: (configuration['encoding'] || DEFAULT_CHARSET),
|
||||
collation: (configuration['collation'] || DEFAULT_COLLATION)
|
||||
}
|
||||
end
|
||||
|
@ -116,7 +116,7 @@ IDENTIFIED BY '#{configuration['password']}' WITH GRANT OPTION;
|
|||
args = [command]
|
||||
args.concat(['--user', configuration['username']]) if configuration['username']
|
||||
args << "--password=#{configuration['password']}" if configuration['password']
|
||||
args.concat(['--default-character-set', configuration['charset']]) if configuration['charset']
|
||||
args.concat(['--default-character-set', configuration['encoding']]) if configuration['encoding']
|
||||
configuration.slice('host', 'port', 'socket').each do |k, v|
|
||||
args.concat([ "--#{k}", v ]) if v
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ module ActiveRecord
|
|||
with('my-app-db', {:charset => 'latin', :collation => 'latin_ci'})
|
||||
|
||||
ActiveRecord::Tasks::DatabaseTasks.create @configuration.merge(
|
||||
'charset' => 'latin', 'collation' => 'latin_ci'
|
||||
'encoding' => 'latin', 'collation' => 'latin_ci'
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -176,7 +176,7 @@ module ActiveRecord
|
|||
with('test-db', {:charset => 'latin', :collation => 'latin_ci'})
|
||||
|
||||
ActiveRecord::Tasks::DatabaseTasks.purge @configuration.merge(
|
||||
'charset' => 'latin', 'collation' => 'latin_ci'
|
||||
'encoding' => 'latin', 'collation' => 'latin_ci'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue