allow creating multiple relationships which includes the same column (fix #2228) (#2232)

This commit is contained in:
Rakesh Emmadi 2019-05-21 10:30:33 +05:30 committed by Shahidh K Muhammed
parent 277be9074e
commit 70f4db19ad

View File

@ -324,8 +324,7 @@ getRequiredFkey col fkeySet preCondition =
"more than one foreign key constraint exists on the given column"
where
filterFkeys = HS.toList $ HS.filter filterFn fkeySet
filterFn k =
preCondition k && isJust (HM.lookup col $ _cfkColumnMapping k)
filterFn k = preCondition k && HM.keys (_cfkColumnMapping k) == [col]
fetchTableFkeys :: QualifiedTable -> Q.TxE QErr (HS.HashSet CatalogFKey)
fetchTableFkeys qt@(QualifiedObject sn tn) = do