We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c482d23 commit 40d9fe5Copy full SHA for 40d9fe5
typo/src/scala/typo/internal/ComputedTable.scala
@@ -15,8 +15,11 @@ case class ComputedTable(
15
val source = Source.Table(dbTable.name)
16
val pointsTo: Map[db.ColName, (Source.Relation, db.ColName)] =
17
dbTable.foreignKeys.flatMap { fk =>
18
- val otherTable: Lazy[HasSource] = eval(fk.otherTable)
19
- val value = fk.otherCols.map(cn => (otherTable.forceGet.source, cn))
+ val otherTable: HasSource =
+ if (fk.otherTable == dbTable.name) this
20
+ else eval(fk.otherTable).forceGet(s"${dbTable.name.value} => ${fk.otherTable.value}")
21
+
22
+ val value = fk.otherCols.map(cn => (otherTable.source, cn))
23
fk.cols.zip(value).toList
24
}.toMap
25
0 commit comments