1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix 'rake db:create' is ignore encoding when using postgres [#5717 state:resolved]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
yalab 2010-10-01 01:26:22 +09:00 committed by Santiago Pastorino
parent 33733d5d1d
commit 91deff08c9

View file

@ -108,7 +108,7 @@ namespace :db do
end end
end end
when 'postgresql' when 'postgresql'
@encoding = config[:encoding] || ENV['CHARSET'] || 'utf8' @encoding = config['encoding'] || ENV['CHARSET'] || 'utf8'
begin begin
ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public')) ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
ActiveRecord::Base.connection.create_database(config['database'], config.merge('encoding' => @encoding)) ActiveRecord::Base.connection.create_database(config['database'], config.merge('encoding' => @encoding))