prisma 1:1 fk

agnusdei1207·2023년 11월 10일
0
model Member {
  id        String    @id @default(uuid())
  password  String?
  email     String   @unique
  picture   String?
  dailyCount Int   @default(0)
  createdAt DateTime @default(now())
  blockedAt DateTime?
  deletedAt DateTime?

  setting   Setting?
}

model Setting {
  id        String    @id @default(uuid())
  member    Member    @relation(fields: [memberId], references: [id])
  memberId  String    @unique
  name      String
  value     String
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}
model Offer {
  id           String       @id @default(uuid())
  interestRate Float
  offerRequest OfferRequest @relation(fields: [offerId], references: [id])
  offerId      String
  company      Company      @relation(fields: [companyId], references: [id])
  companyId    String
  createdAt    DateTime     @default(now())
  updatedAt    DateTime     @updatedAt
  deletedAt    DateTime?
  memos        Json[]       @db.JsonB
  deal         Deal?

  @@map("Offer")
}

model Deal {
  id        String    @id @default(uuid())
  offer     Offer     @relation(fields: [offerId], references: [id])
  offerId   String    @unique
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  deletedAt DateTime?
  memos     Json[]    @db.JsonB

  @@map("Deal")
}

0개의 댓글