mirror of
https://github.com/hknsh/project-knedita.git
synced 2024-11-28 17:41:15 +00:00
style: updated schema spacing
This commit is contained in:
parent
8d345747c6
commit
1c3e46cebb
1 changed files with 16 additions and 16 deletions
|
@ -27,14 +27,14 @@ model User {
|
||||||
}
|
}
|
||||||
|
|
||||||
model Post {
|
model Post {
|
||||||
id String @id @default(uuid())
|
id String @id @default(uuid())
|
||||||
content String
|
content String
|
||||||
authorId String
|
authorId String
|
||||||
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
||||||
likes PostLike[]
|
likes PostLike[]
|
||||||
comments Comments[]
|
comments Comments[]
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
model PostLike {
|
model PostLike {
|
||||||
|
@ -49,11 +49,11 @@ model PostLike {
|
||||||
// I should join these two up? Yeah, but I will not do it since it didn't work on the first time.
|
// I should join these two up? Yeah, but I will not do it since it didn't work on the first time.
|
||||||
|
|
||||||
model CommentLike {
|
model CommentLike {
|
||||||
id String @id @default(uuid())
|
id String @id @default(uuid())
|
||||||
commentId String
|
commentId String
|
||||||
comment Comments @relation(fields: [commentId], references: [id], onDelete: Cascade)
|
comment Comments @relation(fields: [commentId], references: [id], onDelete: Cascade)
|
||||||
userId String
|
userId String
|
||||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,26 +67,26 @@ model Follows {
|
||||||
}
|
}
|
||||||
|
|
||||||
model Comments {
|
model Comments {
|
||||||
id String @id @default(uuid())
|
id String @id @default(uuid())
|
||||||
content String
|
content String
|
||||||
userId String
|
userId String
|
||||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
postId String
|
postId String
|
||||||
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
|
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
|
||||||
likes CommentLike[]
|
likes CommentLike[]
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt @default(now())
|
updatedAt DateTime @updatedAt @default(now())
|
||||||
}
|
}
|
||||||
|
|
||||||
model Notifications {
|
model Notifications {
|
||||||
id String @id @default(uuid())
|
id String @id @default(uuid())
|
||||||
type NotificationType
|
type NotificationType
|
||||||
content String
|
content String
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
fromUserId String
|
fromUserId String
|
||||||
fromUser User? @relation(name: "fromNotifications", fields: [fromUserId], references: [id], onDelete: Cascade)
|
fromUser User? @relation(name: "fromNotifications", fields: [fromUserId], references: [id], onDelete: Cascade)
|
||||||
toUserId String
|
toUserId String
|
||||||
toUser User? @relation(name: "toNotifications", fields: [toUserId], references: [id], onDelete: Cascade)
|
toUser User? @relation(name: "toNotifications", fields: [toUserId], references: [id], onDelete: Cascade)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum NotificationType {
|
enum NotificationType {
|
||||||
|
|
Loading…
Reference in a new issue