提交 28625dbb 编写于 作者: R Ryuta Kamizono

Remove unnecessary `format_string`

`format_string` is used for standardized column types/arguments spaces.
Now the standardization was removed at df84e986.
上级 58e0b1d6
......@@ -145,22 +145,9 @@ def table(table, stream)
# find all migration keys used in this table
keys = @connection.migration_keys
# figure out the lengths for each column based on above keys
lengths = [0] * keys.length
# the string we're going to sprintf our values against, with standardized column widths
format_string = ["%s"] * keys.length
# add column type definition to our format string
format_string.unshift " t.%s "
format_string *= ""
column_specs.each do |colspec|
values = keys.zip(lengths).map { |key, len| colspec.key?(key) ? colspec[key] + ", " : " " * len }
values.unshift colspec[:type]
tbl.print((format_string % values).gsub(/,\s*$/, ""))
tbl.puts
values = keys.map { |key| colspec[key] }.compact
tbl.puts " t.#{colspec[:type]} #{values.join(", ")}"
end
indexes_in_create(table, tbl)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册