A DSJ
08/01/2021, 2:37 PMmodel User {
id String @id @default(uuid())
email String @unique
role Role @default(USER)
group Group? @relation(fields: [group_id], references: [id], onDelete: SetNull)
group_id String
created_at DateTime @default(now())
updated_at DateTime @updatedAt
@@map("user")
}
model Group {
id String @id @default(uuid())
name String
users User[]
created_at DateTime @default(now())
updated_at DateTime @updatedAt
deleted Boolean @default(false)
@@map("group")
}
How can I make this list of User when I already have users User[] for the relation in User model ?
(BTW i've read the doc but i'm totally lost...)
Thanks a lot !Ryan
08/02/2021, 5:41 AMusers User[]
This is what will make sure that all the users are in a group. Is there anything else that you were looking for?A DSJ
08/02/2021, 7:07 AMA DSJ
08/02/2021, 7:07 AMRyan
08/02/2021, 7:19 AMRyan
08/02/2021, 7:20 AMA DSJ
08/02/2021, 7:36 AMA DSJ
08/02/2021, 7:43 AMRyan
08/02/2021, 10:18 AM