Commit 414cfbda authored by Jonne Haß's avatar Jonne Haß

Array#to_h is new in Ruby 2.1, we still suppport 2.0

parent c3bf9dd8
......@@ -37,12 +37,12 @@ class SetMysqlToUnicodeMb4 < ActiveRecord::Migration
def character_columns
# build a hash with all the columns that contain characters
@character_columns ||= tables.map {|table|
@character_columns ||= Hash[tables.map {|table|
col = columns(table)
.select {|column| column.type == :string || column.type == :text }
next if col.empty?
[table, col]
}.compact.to_h
}.compact]
end
def shorten_indexes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment