提交 e6839503 编写于 作者: R Ryuta Kamizono

Should test `test_change_column_default` in `PostgresqlUUIDTest`

Follow up to #25395.
上级 1b795f5f
...@@ -43,20 +43,20 @@ def test_uuid_column_default ...@@ -43,20 +43,20 @@ def test_uuid_column_default
column = UUIDType.columns_hash["thingy"] column = UUIDType.columns_hash["thingy"]
assert_equal "gen_random_uuid()", column.default_function assert_equal "gen_random_uuid()", column.default_function
end end
else end
def test_change_column_default
connection.add_column :uuid_data_type, :thingy, :uuid, null: false, default: "uuid_generate_v1()"
UUIDType.reset_column_information
column = UUIDType.columns_hash["thingy"]
assert_equal "uuid_generate_v1()", column.default_function
connection.change_column :uuid_data_type, :thingy, :uuid, null: false, default: "uuid_generate_v4()" def test_change_column_default
UUIDType.reset_column_information connection.add_column :uuid_data_type, :thingy, :uuid, null: false, default: "uuid_generate_v1()"
column = UUIDType.columns_hash["thingy"] UUIDType.reset_column_information
assert_equal "uuid_generate_v4()", column.default_function column = UUIDType.columns_hash["thingy"]
ensure assert_equal "uuid_generate_v1()", column.default_function
UUIDType.reset_column_information
end connection.change_column :uuid_data_type, :thingy, :uuid, null: false, default: "uuid_generate_v4()"
UUIDType.reset_column_information
column = UUIDType.columns_hash["thingy"]
assert_equal "uuid_generate_v4()", column.default_function
ensure
UUIDType.reset_column_information
end end
def test_data_type_of_uuid_types def test_data_type_of_uuid_types
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册