From 3ce391bb89d76a9fa5c59ccc1a14ee168b1c0379 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 22 Mar 2016 23:37:28 -0400 Subject: [PATCH] Update postgres schema reflection query. 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 --- src/Database/Schema/PostgresSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Database/Schema/PostgresSchema.php b/src/Database/Schema/PostgresSchema.php index 46ea5e0a09d..862a7a213f0 100644 --- a/src/Database/Schema/PostgresSchema.php +++ b/src/Database/Schema/PostgresSchema.php @@ -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'];