mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-07 04:48:46 +00:00
installed minIO and added Endpoints for creating posts and retrieving a post with the ID
This commit is contained in:
parent
38e796ca22
commit
ece95c7130
12 changed files with 962 additions and 71 deletions
|
@ -9,8 +9,118 @@ datasource db {
|
|||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
username String @unique
|
||||
email String
|
||||
password String
|
||||
id String @id @default(uuid())
|
||||
username String @unique
|
||||
email String @unique
|
||||
password String
|
||||
role String @default("user")
|
||||
bio String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt @default(now())
|
||||
|
||||
profilePicture Media? @relation("UserProfilePicture", fields: [profilePictureId], references: [id])
|
||||
profilePictureId String? @unique
|
||||
|
||||
posts Post[]
|
||||
comments Comment[]
|
||||
likes Like[]
|
||||
media Media[] @relation("UploadedMedia")
|
||||
|
||||
following Follow[] @relation("Following")
|
||||
followers Follow[] @relation("Followers")
|
||||
}
|
||||
|
||||
enum PostStatus {
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
ARCHIVED
|
||||
HIDDEN
|
||||
}
|
||||
|
||||
model Post {
|
||||
id String @id @default(uuid())
|
||||
description String
|
||||
status PostStatus @default(PRIVATE)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId String
|
||||
|
||||
comments Comment[]
|
||||
likes Like[]
|
||||
media Media[]
|
||||
postTags PostTag[]
|
||||
}
|
||||
|
||||
model Media {
|
||||
id String @id @default(uuid())
|
||||
originalFilename String
|
||||
objectName String
|
||||
mimeType String
|
||||
size Int
|
||||
uploadDate DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
bucket String
|
||||
|
||||
uploader User @relation("UploadedMedia", fields: [uploaderId], references: [id])
|
||||
uploaderId String
|
||||
|
||||
post Post? @relation(fields: [postId], references: [id])
|
||||
postId String?
|
||||
userWithThisAsProfilePicture User? @relation("UserProfilePicture")
|
||||
}
|
||||
|
||||
|
||||
|
||||
model Comment {
|
||||
id String @id @default(uuid())
|
||||
content String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
post Post @relation(fields: [postId], references: [id])
|
||||
postId String
|
||||
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId String
|
||||
}
|
||||
|
||||
model Like {
|
||||
id String @id @default(uuid())
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
post Post @relation(fields: [postId], references: [id])
|
||||
postId String
|
||||
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId String
|
||||
}
|
||||
|
||||
model Tag {
|
||||
id String @id @default(uuid())
|
||||
name String @unique
|
||||
|
||||
posts PostTag[]
|
||||
}
|
||||
|
||||
model PostTag {
|
||||
postId String
|
||||
tagId String
|
||||
|
||||
post Post @relation(fields: [postId], references: [id])
|
||||
tag Tag @relation(fields: [tagId], references: [id])
|
||||
|
||||
@@id([postId, tagId])
|
||||
}
|
||||
|
||||
model Follow {
|
||||
followingUserId String
|
||||
followedUserId String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
followingUser User @relation("Following", fields: [followingUserId], references: [id])
|
||||
followedUser User @relation("Followers", fields: [followedUserId], references: [id])
|
||||
|
||||
@@id([followingUserId, followedUserId])
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue