Permalink
Browse files

Take postgres schemas into account when retrieving foreign keys.

  • Loading branch information...
1 parent a813df7 commit 5bceeb346812794ef6ad548863ee3cfaeef68e25 @Juanmcuello Juanmcuello committed Mar 13, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/foreigner/connection_adapters/postgresql_adapter.rb
@@ -30,6 +30,7 @@ def foreign_keys(table_name)
WHERE tc.constraint_type = 'FOREIGN KEY'
AND tc.constraint_catalog = '#{@config[:database]}'
AND tc.table_name = '#{table_name}'
+ AND tc.table_schema = ANY (current_schemas(false))
}
fk_info.map do |row|

0 comments on commit 5bceeb3

Please sign in to comment.