KATT
01/17/2022, 7:40 PM@map-ing the relationship tables - for instance i want my _OrgToUser join table to be _org_to_user? i can’t seem to find it in the docsKATT
01/17/2022, 7:43 PMKATT
01/18/2022, 2:46 PM_OrgToUser I know I can rename that now. Is it also possible to rename the columns of that table — they’re right now called A and B which is very cryptic plus capitalized which isn’t normal SQL-convention.
Trying to make sure our data team doesn’t hate me.nikolasburk
nikolasburk
KATT
01/31/2022, 2:03 PMcreatedAt updatedAt on relationships as well
• Can easily store more meta data on the relationship
• All tables that exists are now explicitly declared in *.prisma
• Easier control over relationship table name
• Control over join table columns
• No hidden Prisma-magic when connecting/disconnecting
Cons:
• Slightly more typing in Prisma
• Slightly more typing when “connecting”/“disconnecting”KATT
01/31/2022, 2:04 PMmodel OrgUser {
orgId String @map("org_id")
userId String @map("user_id")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @map("updated_at")
User User @relation(fields: [userId], references: [id])
Org Org @relation(fields: [orgId], references: [id])
@@id([orgId, userId])
@@map("_orgs_to_users")
}nikolasburk