aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-01-05 01:12:25 -0500
committerGitHub <noreply@github.com>2017-01-05 01:12:25 -0500
commitfdef4b7baa7a5374058e3b97697d9531b57265c1 (patch)
tree2c8c0f84d59b905d0adb6da9b7513e0857b1c392
parent209bfc0a5c6416bcba8a90e87159234d72f3e561 (diff)
parent801a21e6c9e619297d43d6e4dcec55fb47fd479c (diff)
downloadrails-fdef4b7baa7a5374058e3b97697d9531b57265c1.tar.gz
rails-fdef4b7baa7a5374058e3b97697d9531b57265c1.tar.bz2
rails-fdef4b7baa7a5374058e3b97697d9531b57265c1.zip
Merge pull request #27580 from kamipo/optimize_information_schema_query
Optimizing information_schema query for `foreign_keys`
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index fbc510bc0e..aedf4581f5 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -527,6 +527,7 @@ module ActiveRecord
WHERE fk.referenced_column_name IS NOT NULL
AND fk.table_schema = #{quote(schema)}
AND fk.table_name = #{quote(name)}
+ AND rc.table_name = #{quote(name)}
SQL
fk_info.map do |row|