diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-29 12:28:12 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-29 12:28:12 -0700 |
commit | cea06a8e3f1f129ef330b346a38571a8a3309812 (patch) | |
tree | 1d11a2efde70834e001385809426c82f2314eb57 /activerecord/lib | |
parent | 3d6e1872550f284dd387ffc87a984a9036376062 (diff) | |
download | rails-cea06a8e3f1f129ef330b346a38571a8a3309812.tar.gz rails-cea06a8e3f1f129ef330b346a38571a8a3309812.tar.bz2 rails-cea06a8e3f1f129ef330b346a38571a8a3309812.zip |
default writing the schema file as utf-8
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 0ee7e20cf1..ec00f7faad 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -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' task :dump => :load_config do 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::SchemaDumper.dump(ActiveRecord::Base.connection, file) end |