You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`You can only set db.foreignKey on one side of a one to one relationship, but foreignKey is set on both ${left.listKey}.${left.fieldPath} and ${right.listKey}.${right.fieldPath}`
thrownewError(`You can only set db.foreignKey on one side of a one to one relationship, but foreignKey is set on both ${left.listKey}.${left.fieldPath} and ${right.listKey}.${right.fieldPath}`)
50
44
}
45
+
46
+
// return the field that specifies the foreignKey first
// - for the one side, TypeScript will already disallow relationName
57
-
if(rels[1].field.relationName!==undefined){
58
-
thrownewError(
59
-
`You can only set db.relationName on one side of a many to many relationship, but db.relationName is set on ${rels[1].listKey}.${rels[1].fieldPath} which is the many side of a many to one relationship with ${rels[0].listKey}.${rels[0].fieldPath}`
60
-
)
61
-
}
56
+
if(rels[1].field.relationName!==undefined)thrownewError(`You can only set db.relationName on one side of a many to many relationship, but db.relationName is set on ${rels[1].listKey}.${rels[1].fieldPath} which is the many side of a many to one relationship with ${rels[0].listKey}.${rels[0].fieldPath}`)
`You can only set db.relationName on one side of a many to many relationship, but db.relationName is set on both ${left.listKey}.${left.fieldPath} and ${right.listKey}.${right.fieldPath}`
72
-
)
65
+
thrownewError(`You can only set db.relationName on one side of a many to many relationship, but db.relationName is set on both ${left.listKey}.${left.fieldPath} and ${right.listKey}.${right.fieldPath}`)
thrownewError(`The relationship field at ${listKey}.${fieldPath} points to the list ${field.list}, Keystone needs to a create a relationship field at ${field.list}.${foreignFieldPath} to support the relationship at ${listKey}.${fieldPath} but ${field.list} already has a field named ${foreignFieldPath}`)
@@ -269,6 +255,7 @@ export function resolveRelationships (
269
255
}
270
256
}
271
257
}
258
+
272
259
// the way we resolve the relationships means that the relationships will be in a
273
260
// different order than the order the user specified in their config
274
261
// doesn't really change the behaviour of anything but it means that the order of the fields in the prisma schema will be
0 commit comments