Reference naming doesn't fit all use-cases

As title says, I'm extending organizations plugin and I'm referencing organizationId
schema: {
branch: {
fields: {
organizationId: {
type: "string",
required: true,
references: {
model: "organization",
field: "id",
},
},
}
}
}
schema: {
branch: {
fields: {
organizationId: {
type: "string",
required: true,
references: {
model: "organization",
field: "id",
},
},
}
}
}
The generated reference in Organization model
model Organization {
id String @id
name String
slug String?
logo String?
createdAt DateTime
metadata String?
members Member[]
invitations Invitation[]

teams Team[]

branchs Branch[]

@@unique([slug])
@@map("organization")
}
model Organization {
id String @id
name String
slug String?
logo String?
createdAt DateTime
metadata String?
members Member[]
invitations Invitation[]

teams Team[]

branchs Branch[]

@@unique([slug])
@@map("organization")
}
It should be branches. How can I fix that?
No description
6 Replies
Ping
Ping2w ago
Oh wait is this Prisma? Okay Drizzle adapter also has this issue too. I'll see if I can fix up Prisma as well.
Maqed
MaqedOP2w ago
Okay I'm waiting
Ping
Ping2w ago
Okay this is a different error to what I was expecting. Not sure you can do much about this. It's intentionally hard coded to add an s, unfortunately. @Maqed
Maqed
MaqedOP2w ago
Isn't there any way to make customizable
Ping
Ping2w ago
No, sorry.
Maqed
MaqedOP2w ago
It's okay

Did you find this page helpful?