feat: Add createdAt and updatedAt in schema

This commit is contained in:
Roman Godmaire 2023-11-19 20:19:45 -05:00
parent 0e697aa1dd
commit 328c724508

View file

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