From 328c724508a0de2b90e273a7d0aee5e0307400ff Mon Sep 17 00:00:00 2001 From: Roman Godmaire Date: Sun, 19 Nov 2023 20:19:45 -0500 Subject: [PATCH] feat: Add createdAt and updatedAt in schema --- prisma/schema.prisma | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 2e48160..0899bb1 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -39,32 +39,40 @@ model Key { // Application stuff model Track { - id Int @id @default(autoincrement()) - title String - objectKey String + id Int @id @default(autoincrement()) + title String + objectKey String - producer User @relation(fields: [producerId], references: [id], onDelete: Cascade) + producer User @relation(fields: [producerId], references: [id], onDelete: Cascade) producerId String - versions TrackVersion[] + versions TrackVersion[] + + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model TrackVersion { - id Int @id @default(autoincrement()) + id Int @id @default(autoincrement()) - track Track @relation(fields: [trackId], references: [id], onDelete: Cascade) - trackId Int + track Track @relation(fields: [trackId], references: [id], onDelete: Cascade) + trackId Int - comments Comment[] + comments Comment[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model Comment { - id Int @id @default(autoincrement()) - content String + id Int @id @default(autoincrement()) + content String - author User @relation(fields: [authorId], references: [id]) - authorId String + author User @relation(fields: [authorId], references: [id]) + authorId String trackVersion TrackVersion @relation(fields: [trackVersionId], references: [id], onDelete: Cascade) trackVersionId Int + + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt }