Hi all! I just upgraded to Prisma 1.31 / Datamodel...
# orm-help
n
Hi all! I just upgraded to Prisma 1.31 / Datamodel 1.1 and I'm getting some weird errors when I try to deploy (I completely rewrote my
datamodel.prisma
to fit the new spec, and wiped all the tables in my database). Here's my error:
Content
✖️ The relation field
bundle
must specify a
@relation
directive:
@relation(name: "MyRelation")
In my datamodel, this is how I specified `Content`:
Copy code
type Content @db(name: "content") {
  id: ID! @id
  contentType: ContentType! # ENUM
  bundle: Bundle @relation(link: INLINE)
  image: Image @relation(link: INLINE)
}
Am I missing something obvious?
bundle
and
image
are 1:1 relations.
👍 1
j
if understand correctly, keep the name, but only one side of the relation take
link
n
I believe I did that. In Bundle and Image I have
super: Content!
(with no
@relation
directive)
I get an error for Bundle.super, but not Image.super, which is super weird
Oh! I think I might know what's up. In Bundle, I have
Copy code
members: [Content] @relation(link: TABLE, name: "BundleMember")
  super: Content!
is it because those aren't disambigulated enough?
Ah yep, it looks like I need to add a relation name to both sides of that Content.bundle / Bundle.super relation