Fix unique foreign key in view (#1395)

This commit is contained in:
Steve Chávez
2019-10-16 12:45:38 -05:00
committed by GitHub
parent a3701f5de8
commit 80f763448f
7 changed files with 53 additions and 2 deletions
+2 -2
View File
@@ -393,7 +393,7 @@ allColumns tabs =
array_to_string(enum_info.vals, ',') AS enum
FROM (
/*
-- CTE based on pg_catalog to get only Primary and Foreign key columns outside api schema
-- CTE based on pg_catalog to get PRIMARY/FOREIGN key and UNIQUE columns outside api schema
*/
WITH key_columns AS (
SELECT
@@ -409,7 +409,7 @@ allColumns tabs =
pg_catalog.pg_class c,
pg_catalog.pg_namespace n
WHERE
r.contype IN ('f', 'p')
r.contype IN ('f', 'p', 'u')
AND c.relkind IN ('r', 'v', 'f', 'm')
AND r.conrelid = c.oid
AND c.relnamespace = n.oid