many breaking changes/fixes

This commit is contained in:
Daniel
2023-03-28 11:01:50 +03:30
parent 3a5ae28f86
commit b9567ca3c2
43 changed files with 1180 additions and 466 deletions
+6 -5
View File
@@ -13,6 +13,7 @@ model User {
email String @unique
password String
collections Collection[]
tags Tag[]
collectionsJoined UsersAndCollections[]
createdAt DateTime @default(now())
}
@@ -24,8 +25,9 @@ model Collection {
ownerId Int
members UsersAndCollections[]
links Link[]
tags Tag[]
createdAt DateTime @default(now())
@@unique([name, ownerId])
}
model UsersAndCollections {
@@ -50,7 +52,6 @@ model Link {
collection Collection @relation(fields: [collectionId], references: [id])
collectionId Int
tags Tag[]
starred Boolean
screenshotPath String
pdfPath String
createdAt DateTime @default(now())
@@ -60,8 +61,8 @@ model Tag {
id Int @id @default(autoincrement())
name String
links Link[]
collections Collection @relation(fields: [collectionId], references: [id])
collectionId Int
owner User @relation(fields: [ownerId], references: [id])
ownerId Int
@@unique([name, collectionId])
@@unique([name, ownerId])
}