Fix table comment also being applied to the primary key column

上级 06ae49d9
* Fix table comment also being applied to the primary key column
*Guilherme Goettems Schneider*
* Allow generated `create_table` migrations to include or skip timestamps.
*Michael Duchemin*
......
......@@ -302,7 +302,7 @@ def create_table(table_name, **options)
if pk.is_a?(Array)
td.primary_keys pk
else
td.primary_key pk, options.fetch(:id, :primary_key), options
td.primary_key pk, options.fetch(:id, :primary_key), options.except(:comment)
end
end
......
......@@ -44,6 +44,11 @@ class BlankComment < ActiveRecord::Base
@connection.drop_table "blank_comments", if_exists: true
end
def test_primary_key_comment
column = Commented.columns_hash["id"]
assert_nil column.comment
end
def test_column_created_in_block
column = Commented.columns_hash["name"]
assert_equal :string, column.type
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册