Skip to content

Commit

Permalink
#8 - Updated prisma schema
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikpyt committed Oct 3, 2023
1 parent 29fa9f3 commit 3a29c78
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ model User {
email String @unique @db.VarChar(255)
password String @db.Text
sessions UserSession[]
Item Item[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
sessions UserSession[]
Item Item[]
ItemSharing ItemSharing[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model UserSession {
Expand All @@ -48,13 +48,10 @@ model Item {
ownerId Int
parentId Int?
owner User @relation(fields: [ownerId], references: [id])
parentItem Item? @relation("ItemToItem", fields: [parentId], references: [id])
Items Item[] @relation("ItemToItem")
ItemBlob ItemBlob?
owner User @relation(fields: [ownerId], references: [id])
parentItem Item? @relation("ItemToItem", fields: [parentId], references: [id])
Items Item[] @relation("ItemToItem")
ItemBlob ItemBlob?
ItemSharing ItemSharing[]
createdAt DateTime @default(now())
Expand All @@ -81,7 +78,6 @@ model ItemSharing {
userId Int
item Item @relation(fields: [itemId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
Expand Down

0 comments on commit 3a29c78

Please sign in to comment.