feat: Add createdAt and updatedAt in schema
This commit is contained in:
parent
0e697aa1dd
commit
328c724508
1 changed files with 21 additions and 13 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue