提交 36f6ab2d 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #26753 from kamipo/fix_table_comment_dumping

Fix table comment dumping
......@@ -239,7 +239,9 @@ def new_column(*args) # :nodoc:
end
def table_options(table_name) # :nodoc:
{ comment: table_comment(table_name) }
if comment = table_comment(table_name)
{ comment: comment }
end
end
# Returns a comment stored in database for given table
......
......@@ -229,7 +229,7 @@ def foreign_keys(table, stream)
end
def format_options(options)
options.map { |key, value| "#{key}: #{value.inspect}" if value }.compact.join(", ")
options.map { |key, value| "#{key}: #{value.inspect}" }.join(", ")
end
def remove_prefix_and_suffix(table)
......
......@@ -51,6 +51,7 @@ def test_schema_dump
output = standard_dump
assert_match %r{create_table "accounts"}, output
assert_match %r{create_table "authors"}, output
assert_no_match %r{(?<=, ) do \|t\|}, output
assert_no_match %r{create_table "schema_migrations"}, output
assert_no_match %r{create_table "ar_internal_metadata"}, output
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册