提交 e0e91860 编写于 作者: M Matthew Draper

Merge pull request #20815 from byroot/do-not-include-column-limit-if-it-is-default

Do not include column limit in schema.rb if it matches the default
* Omit default limit values in dumped schema. It's tidier, and if the defaults
change in the future, we can address that via Migration API Versioning.
*Jean Boussier*
* Support passing the schema name as a prefix to table name in
`ConnectionAdapters::SchemaStatements#indexes`. Previously the prefix would
be considered a full part of the index name, and only the schema in the
......
......@@ -61,8 +61,8 @@ def schema_type(column)
end
def schema_limit(column)
limit = column.limit || native_database_types[column.type][:limit]
limit.inspect if limit
limit = column.limit
limit.inspect if limit && limit != native_database_types[column.type][:limit]
end
def schema_precision(column)
......
......@@ -118,7 +118,7 @@ def test_schema_dump_includes_limit_constraint_for_integer_columns
assert_match %r{c_int_4.*}, output
assert_no_match %r{c_int_4.*limit:}, output
elsif current_adapter?(:Mysql2Adapter)
assert_match %r{c_int_without_limit.*limit: 4}, output
assert_match %r{c_int_without_limit"$}, output
assert_match %r{c_int_1.*limit: 1}, output
assert_match %r{c_int_2.*limit: 2}, output
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册