mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
default writing the schema file as utf-8
This commit is contained in:
parent
17a66a8ddc
commit
4a74493816
1 changed files with 2 additions and 1 deletions
|
@ -341,7 +341,8 @@ db_namespace = namespace :db do
|
||||||
desc 'Create a db/schema.rb file that can be portably used against any DB supported by AR'
|
desc 'Create a db/schema.rb file that can be portably used against any DB supported by AR'
|
||||||
task :dump => :load_config do
|
task :dump => :load_config do
|
||||||
require 'active_record/schema_dumper'
|
require 'active_record/schema_dumper'
|
||||||
File.open(ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb", "w") do |file|
|
filename = ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb"
|
||||||
|
File.open(filename, "w:utf-8") do |file|
|
||||||
ActiveRecord::Base.establish_connection(Rails.env)
|
ActiveRecord::Base.establish_connection(Rails.env)
|
||||||
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
|
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue