Skip to content

Commit

Permalink
feat(schema): add user relation (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaemin committed Jan 31, 2021
1 parent a9560d0 commit c810f07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions prisma/schema.dev.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,21 @@ model User {
liveChats LiveChat[]
noticeNotificationsSubscriptions NoticeNotificationsSubscription[]
pushes Push[]
reports Report[] @relation("reportTouser")
@@map("user")
}

model Report {
id Int @id @default(autoincrement()) @db.UnsignedInt
userId Int @map("user_id") @db.UnsignedInt
target String @default("") @db.VarChar(100)
targetId Int @map("target_id") @db.UnsignedInt
title String @default("") @db.VarChar(100)
body String? @db.Text
reportedAt DateTime @map("reported_at") @db.DateTime(0)
user User @relation("reportTouser", fields: [userId], references: [id])
@@index([userId], name: "user_id")
@@map("report")
}

0 comments on commit c810f07

Please sign in to comment.