So the Password table is a relation to the User. b...
# orm-help
j
So the Password table is a relation to the User. but why is this modelled in a seperate table?
๐Ÿ‘€ 1
n
Hello @Jordansz ๐Ÿ‘‹ It isnโ€™t necessary to model Password in a separate table, As only the hash is stored in the Password model and there is a 1:1 relation between both models, you could instead keep the hash field in the User model as well.
Copy code
model User {
  id    String @id @default(cuid())
  email String @unique

  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  hash     String
  notes    Note[]
}
v
๐Ÿ‘‹ Hello @Jordansz have you perhaps have a chance to check Nurul's answer? Let us know if you still have questions!