aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/schema_dumper.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2014-11-10 13:53:27 +0900
committerRyuta Kamizono <kamipo@gmail.com>2015-03-06 18:56:19 +0900
commit0aa83f3b88c71df4f29b8c52d6297e2e5886e258 (patch)
treee18f89c0e6c04bf6cd0585cc01e761db18622fe9 /activerecord/lib/active_record/schema_dumper.rb
parenteac3349285718e2a145c1e85e1fdb7bf96fc5bd1 (diff)
downloadrails-0aa83f3b88c71df4f29b8c52d6297e2e5886e258.tar.gz
rails-0aa83f3b88c71df4f29b8c52d6297e2e5886e258.tar.bz2
rails-0aa83f3b88c71df4f29b8c52d6297e2e5886e258.zip
Add `:charset` and `:collation` options support for MySQL string and text columns
Example: create_table :foos do |t| t.string :string_utf8_bin, charset: 'utf8', collation: 'utf8_bin' t.text :text_ascii, charset: 'ascii' end
Diffstat (limited to 'activerecord/lib/active_record/schema_dumper.rb')
-rw-r--r--activerecord/lib/active_record/schema_dumper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb
index da95920571..eaeaf0321b 100644
--- a/activerecord/lib/active_record/schema_dumper.rb
+++ b/activerecord/lib/active_record/schema_dumper.rb
@@ -105,7 +105,10 @@ HEADER
end
def table(table, stream)
- columns = @connection.columns(table)
+ columns = @connection.columns(table).map do |column|
+ column.instance_variable_set(:@table_name, table)
+ column
+ end
begin
tbl = StringIO.new