提交 9d5217db 编写于 作者: R Ryuta Kamizono

Prefer `USING (column_list)` for joining information_schema

上级 2f8d22f2
......@@ -367,9 +367,7 @@ def primary_keys(table_name) # :nodoc:
SELECT column_name
FROM information_schema.key_column_usage kcu
JOIN information_schema.table_constraints tc
ON kcu.table_name = tc.table_name
AND kcu.table_schema = tc.table_schema
AND kcu.constraint_name = tc.constraint_name
USING (table_schema, table_name, constraint_name)
WHERE constraint_type = 'PRIMARY KEY'
AND kcu.table_name = #{scope[:name]}
AND kcu.table_schema = #{scope[:schema]}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册