diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-06-07 06:16:56 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-06-07 06:16:56 +0900 |
commit | 16bb3d6f122c32e828a23ba24ffb14d60fdb9ba3 (patch) | |
tree | 449179b28f78d13449028b72b549b952f308d76e /activerecord | |
parent | 3da81f89ab83a2501fd1ea2710e5e3bc16a87a56 (diff) | |
download | rails-16bb3d6f122c32e828a23ba24ffb14d60fdb9ba3.tar.gz rails-16bb3d6f122c32e828a23ba24ffb14d60fdb9ba3.tar.bz2 rails-16bb3d6f122c32e828a23ba24ffb14d60fdb9ba3.zip |
Make `foreign_keys` queries to `SCHEMA`
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | 2 |
2 files changed, 2 insertions, 2 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 718a6c5b91..76effdddb4 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -515,7 +515,7 @@ module ActiveRecord schema, name = extract_schema_qualified_name(table_name) - fk_info = select_all <<-SQL.strip_heredoc + fk_info = select_all(<<-SQL.strip_heredoc, 'SCHEMA') SELECT fk.referenced_table_name as 'to_table' ,fk.referenced_column_name as 'primary_key' ,fk.column_name as 'column' diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index 6318b1c65a..94f4f81e6c 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -579,7 +579,7 @@ module ActiveRecord end def foreign_keys(table_name) - fk_info = select_all <<-SQL.strip_heredoc + fk_info = select_all(<<-SQL.strip_heredoc, 'SCHEMA') SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete FROM pg_constraint c JOIN pg_class t1 ON c.conrelid = t1.oid |