Skip to content

Commit

Permalink
Fixed many-to-many Prisma relationship between users and files
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Feb 9, 2024
1 parent b0a1f72 commit 81cdc01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ datasource db {

// Déclaration des modèles de données pour Next Auth.
model Account {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId String
type String
provider String
Expand All @@ -22,8 +23,6 @@ model Account {
id_token String?
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@id([provider, providerAccountId])
}

Expand Down Expand Up @@ -87,12 +86,13 @@ model Preference {
}

model Share {
id Int @id @default(autoincrement())
file File @relation(fields: [fileId], references: [id], onDelete: Cascade)
fileId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId String
status String @default("read")
@@id([fileId, userId])
}

model User {
Expand Down

0 comments on commit 81cdc01

Please sign in to comment.