提交 aaffc2ac 编写于 作者: M Marcelo Silveira

improved test case for partial indices

上级 7ef22fce
......@@ -169,14 +169,17 @@ def test_add_index
connection.add_index("testings", ["last_name", "first_name"], :order => :desc)
connection.remove_index("testings", ["last_name", "first_name"])
end
# Selected adapters support partial indices
if current_adapter?(:PostgreSQLAdapter)
connection.add_index("testings", ["last_name"], :where => "first_name = 'john doe'")
connection.remove_index("testings", ["last_name"])
end
end
def test_add_partial_index
skip 'only on pg' unless current_adapter?(:PostgreSQLAdapter)
connection.add_index("testings", "last_name", :where => "first_name = 'john doe'")
assert connection.index_exists?("testings", "last_name")
connection.remove_index("testings", "last_name")
assert !connection.index_exists?("testings", "last_name")
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册