Added tag support + Post link and many more changes and optimizations.
This commit is contained in:
+15
-6
@@ -1,6 +1,3 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
@@ -16,7 +13,7 @@ model User {
|
||||
email String @unique
|
||||
password String
|
||||
collections Collection[]
|
||||
collectionsJoined UserAndCollection[]
|
||||
collectionsJoined UsersAndCollections[]
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
@@ -25,12 +22,13 @@ model Collection {
|
||||
name String
|
||||
owner User @relation(fields: [ownerId], references: [id])
|
||||
ownerId Int
|
||||
members UserAndCollection[]
|
||||
members UsersAndCollections[]
|
||||
links Link[]
|
||||
tags Tag[]
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model UserAndCollection {
|
||||
model UsersAndCollections {
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId Int
|
||||
|
||||
@@ -51,4 +49,15 @@ model Link {
|
||||
url String
|
||||
collection Collection @relation(fields: [collectionId], references: [id])
|
||||
collectionId Int
|
||||
tags Tag[]
|
||||
}
|
||||
|
||||
model Tag {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
links Link[]
|
||||
collections Collection @relation(fields: [collectionId], references: [id])
|
||||
collectionId Int
|
||||
|
||||
@@unique([name, collectionId])
|
||||
}
|
||||
Reference in New Issue
Block a user