refactor: improve disambiguation error message

* reverse backwards relationships
* remove redundancy from getJoinSelects
* properly name Cardinality constructors
This commit is contained in:
steve-chavez
2019-11-17 13:28:21 -05:00
committed by Steve Chavez
parent 4ef6926791
commit f9c64d9f65
6 changed files with 186 additions and 186 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ compressedRel rel =
, "target" .= fmt (tableSchema fTab) (tableName fTab) (colName <$> relFColumns rel)
, "cardinality" .= (show $ relType rel :: Text)
] ++
if relType rel == Many
if relType rel == M2M
then [
"junction" .= case (relLinkTable rel, relLinkCols1 rel, relLinkCols2 rel) of
(Just lt, Just lc1, Just lc2) -> fmtMany (tableSchema lt) (tableName lt) (colName <$> lc1) (colName <$> lc2)