style: updated schema spacing

This commit is contained in:
Hackntosh 2023-09-30 18:00:19 -03:00
parent 8d345747c6
commit 1c3e46cebb

View file

@ -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 {