fix: Expose PKs from all tables in a view

Fixes a regression in d2719420f4.

Resolves #2458

Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
Wolfgang Walther
2022-10-24 16:49:32 +02:00
committed by Wolfgang Walther
parent 2158f3d039
commit 6fe1617348
4 changed files with 36 additions and 5 deletions
+2 -2
View File
@@ -428,8 +428,8 @@ addViewPrimaryKeys tabs keyDeps =
else tbl) <$> tabs
where
findViewPKCols sch vw =
maybe [] (\(ViewKeyDependency _ _ _ _ pkCols) -> snd <$> pkCols) $
find (\(ViewKeyDependency _ viewQi _ dep _) -> dep == PKDep && viewQi == QualifiedIdentifier sch vw) keyDeps
concatMap (\(ViewKeyDependency _ _ _ _ pkCols) -> snd <$> pkCols) $
filter (\(ViewKeyDependency _ viewQi _ dep _) -> dep == PKDep && viewQi == QualifiedIdentifier sch vw) keyDeps
allTables :: PgVersion -> Bool -> SQL.Statement [Schema] TablesMap
allTables pgVer =