Skip to content

Commit

Permalink
Update postgres schema reflection query.
Browse files Browse the repository at this point in the history
Use different conditions in foreign key reflection that match index
reflection. This should solve issues around tables in non-default
schemas failing to reflect correctly.

Refs #8503
  • Loading branch information
markstory committed Mar 23, 2016
1 parent 5ab1b5d commit 3ce391b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Schema/PostgresSchema.php
Expand Up @@ -283,7 +283,7 @@ public function describeForeignKeySql($tableName, $config)
INNER JOIN pg_catalog.pg_attribute a ON (a.attrelid = cl.oid AND c.conrelid = a.attrelid AND a.attnum = ANY(c.conkey))
INNER JOIN pg_catalog.pg_attribute ab ON (a.attrelid = cl.oid AND c.confrelid = ab.attrelid AND ab.attnum = ANY(c.confkey))
WHERE n.nspname = ?
AND c.conrelid = ?::regclass
AND cl.relname = ?
ORDER BY name, a.attnum, ab.attnum DESC";

$schema = empty($config['schema']) ? 'public' : $config['schema'];
Expand Down

0 comments on commit 3ce391b

Please sign in to comment.