chore: update migration

This commit is contained in:
Methapon2001 2024-06-12 14:09:08 +07:00
parent 28d002ad65
commit 31ed48d190
4 changed files with 91 additions and 13 deletions

View file

@ -547,30 +547,44 @@ model Service {
createdAt DateTime @default(now())
updateBy String?
updatedAt DateTime @updatedAt
work Work[]
workOnService WorkService[]
}
model Work {
id String @id @default(uuid())
order Int
name String
service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
serviceId String
name String
status Status @default(CREATED)
createdBy String?
createdAt DateTime @default(now())
updateBy String?
updatedAt DateTime @updatedAt
WorkProduct WorkProduct[]
createdBy String?
createdAt DateTime @default(now())
updateBy String?
updatedAt DateTime @updatedAt
productOnWork WorkProduct[]
serviceOnWork WorkService[]
}
model WorkService {
order Int
work Work @relation(fields: [workId], references: [id], onDelete: Cascade)
workId String
service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
serviceId String
createdBy String?
createdAt DateTime @default(now())
updateBy String?
updatedAt DateTime @updatedAt
productId String?
@@id([workId, serviceId])
}
model WorkProduct {
id String @id @default(uuid())
order Int
work Work @relation(fields: [workId], references: [id], onDelete: Cascade)
workId String
product Product @relation(fields: [productId], references: [id], onDelete: Cascade)
@ -580,6 +594,8 @@ model WorkProduct {
createdAt DateTime @default(now())
updateBy String?
updatedAt DateTime @updatedAt
@@id([workId, productId])
}
model ProductGroup {