X
Xata2mo ago
Helim

Column is not an object or link

Hey I am trying to create an relation in my database schema. I am using Prisma ORM. Somehow this schema makes the xata.io table view break more specifically the view for Child table. It says "Error loading data... columns invalid: column [parentId]: column is not an object or link". I have done the modification thing that xata prompts me for when I first open the viewer I just have not pulled the schema to my prisma.schema as I thought it was more clear to only show the schema I wrote. What am I doing wrong? schema.prisma
model Parent {
id String @id @default(uuid())
name String
Child Child[]
}

model Child {
id String @id @default(uuid())
name String

parent Parent @relation(fields: [parentId], references: [id])
parentId String
}
model Parent {
id String @id @default(uuid())
name String
Child Child[]
}

model Child {
id String @id @default(uuid())
name String

parent Parent @relation(fields: [parentId], references: [id])
parentId String
}
2 Replies
cmck
cmck2mo ago
Hi Helim, thanks for pointing this out. We're working on fixing the view for the child table. As a workaround, you should be able to reference the xata_id field in the child table which will allow the child table to render in the UI.
Helim
HelimOP2mo ago
Okay thanks, the workaround fixed this for now.
Want results from more Discord servers?
Add your server