chore: update constraints

This commit is contained in:
Methapon Metanipat 2024-10-01 15:41:23 +07:00
parent ca8aec6c4f
commit f3e4526c16
2 changed files with 13 additions and 2 deletions

View file

@ -0,0 +1,11 @@
-- DropForeignKey
ALTER TABLE "QuotationProductServiceList" DROP CONSTRAINT "QuotationProductServiceList_quotationId_fkey";
-- DropForeignKey
ALTER TABLE "QuotationWorker" DROP CONSTRAINT "QuotationWorker_quotationId_fkey";
-- AddForeignKey
ALTER TABLE "QuotationWorker" ADD CONSTRAINT "QuotationWorker_quotationId_fkey" FOREIGN KEY ("quotationId") REFERENCES "Quotation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "QuotationProductServiceList" ADD CONSTRAINT "QuotationProductServiceList_quotationId_fkey" FOREIGN KEY ("quotationId") REFERENCES "Quotation"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View file

@ -1081,14 +1081,14 @@ model QuotationWorker {
code String
employee Employee @relation(fields: [employeeId], references: [id])
employeeId String
quotation Quotation @relation(fields: [quotationId], references: [id])
quotation Quotation @relation(fields: [quotationId], references: [id], onDelete: Cascade)
quotationId String
}
model QuotationProductServiceList {
id String @id @default(cuid())
quotationId String
quotation Quotation @relation(fields: [quotationId], references: [id])
quotation Quotation @relation(fields: [quotationId], references: [id], onDelete: Cascade)
order Int